|
|
|
@ -293,7 +293,29 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|
|
|
|
|
|
|
|
|
return remote_path
|
|
|
|
|
|
|
|
|
|
def _fixup_perms(self, remote_paths, remote_user, execute=True):
|
|
|
|
|
def _fixup_perms(self, remote_path, remote_user, execute=True, recursive=True):
|
|
|
|
|
"""
|
|
|
|
|
We need the files we upload to be readable (and sometimes executable)
|
|
|
|
|
by the user being sudo'd to but we want to limit other people's access
|
|
|
|
|
(because the files could contain passwords or other private
|
|
|
|
|
information.
|
|
|
|
|
|
|
|
|
|
Deprecated in favor of _fixup_perms2. Ansible code has been updated to
|
|
|
|
|
use _fixup_perms2. This code is maintained to provide partial support
|
|
|
|
|
for custom actions (non-recursive mode only).
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
display.deprecated('_fixup_perms is deprecated. Use _fixup_perms2 instead.', version='2.4', removed=False)
|
|
|
|
|
|
|
|
|
|
if recursive:
|
|
|
|
|
raise AnsibleError('_fixup_perms with recursive=True (the default) is no longer supported. ' +
|
|
|
|
|
'Use _fixup_perms2 if support for previous releases is not required. '
|
|
|
|
|
'Otherwise use fixup_perms with recursive=False.')
|
|
|
|
|
|
|
|
|
|
return self._fixup_perms2([remote_path], remote_user, execute)
|
|
|
|
|
|
|
|
|
|
def _fixup_perms2(self, remote_paths, remote_user, execute=True):
|
|
|
|
|
"""
|
|
|
|
|
We need the files we upload to be readable (and sometimes executable)
|
|
|
|
|
by the user being sudo'd to but we want to limit other people's access
|
|
|
|
@ -618,7 +640,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|
|
|
|
# Fix permissions of the tmp path and tmp files. This should be
|
|
|
|
|
# called after all files have been transferred.
|
|
|
|
|
if remote_files:
|
|
|
|
|
self._fixup_perms(remote_files, remote_user)
|
|
|
|
|
self._fixup_perms2(remote_files, remote_user)
|
|
|
|
|
|
|
|
|
|
cmd = ""
|
|
|
|
|
in_data = None
|
|
|
|
|