Altered code to support salt-ssh on AIX

This commit is contained in:
David Murphy 2019-04-02 14:02:14 -06:00
parent 8fa0e51336
commit 6d98577e37
2 changed files with 10 additions and 1 deletions

View file

@ -118,7 +118,8 @@ def need_deployment():
if dstat.st_uid != euid:
# Attack detected, try again
need_deployment()
if dstat.st_mode != 16832:
# AIX has non-POSIX bit 0o240700, isolate to 0o40700
if dstat.st_mode & ~65536 != 16832:
# Attack detected
need_deployment()
# If SUDOing then also give the super user group write permissions

View file

@ -45,6 +45,14 @@ def _load_libcrypto():
# two checks below
lib = glob.glob('/opt/local/lib/libcrypto.so*') + glob.glob('/opt/tools/lib/libcrypto.so*')
lib = lib[0] if len(lib) > 0 else None
if not lib and salt.utils.platform.is_aix():
if os.ospath.isdir('/opt/salt/lib'):
# preference for Salt installed fileset
lib = glob.glob('/opt/salt/lib/libcrypto.so*')
lib = lib[0] if len(lib) > 0 else None
else:
lib = glob.glob('/opt/freeware/lib/libcrypto.so*')
lib = lib[0] if len(lib) > 0 else None
if lib:
return cdll.LoadLibrary(lib)
raise OSError('Cannot locate OpenSSL libcrypto')