Merge pull request #52396 from dmurphy18/fix_aix_ssh

Altered code to support salt-ssh on AIX
This commit is contained in:
Thomas S Hatch 2019-04-12 09:57:07 -06:00 committed by GitHub
commit 0d096086dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

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

View File

@ -45,6 +45,14 @@ def _load_libcrypto():
# two checks below # two checks below
lib = glob.glob('/opt/local/lib/libcrypto.so*') + glob.glob('/opt/tools/lib/libcrypto.so*') lib = glob.glob('/opt/local/lib/libcrypto.so*') + glob.glob('/opt/tools/lib/libcrypto.so*')
lib = lib[0] if len(lib) > 0 else None lib = lib[0] if len(lib) > 0 else None
if not lib and salt.utils.platform.is_aix():
if os.path.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: if lib:
return cdll.LoadLibrary(lib) return cdll.LoadLibrary(lib)
raise OSError('Cannot locate OpenSSL libcrypto') raise OSError('Cannot locate OpenSSL libcrypto')