mention acl in permissions errors (#79209)

as chmod/mode is not the only thing we attempt and Ubuntu not shipping acl
  in newer versions can lead to some confusion

  fixes #79146
pull/79254/head
Brian Coca 3 years ago committed by GitHub
parent aaab0791d9
commit 0f18ddca9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- updated error messages to include 'acl' and not just mode changes when failing to set required permissions on remote.

@ -674,7 +674,7 @@ class ActionBase(ABC):
res = self._remote_chmod(remote_paths, 'u+x') res = self._remote_chmod(remote_paths, 'u+x')
if res['rc'] != 0: if res['rc'] != 0:
raise AnsibleError( raise AnsibleError(
'Failed to set file mode on remote temporary files ' 'Failed to set file mode or acl on remote temporary files '
'(rc: {0}, err: {1})'.format( '(rc: {0}, err: {1})'.format(
res['rc'], res['rc'],
to_native(res['stderr']))) to_native(res['stderr'])))
@ -689,9 +689,9 @@ class ActionBase(ABC):
if remote_user in self._get_admin_users(): if remote_user in self._get_admin_users():
raise AnsibleError( raise AnsibleError(
'Failed to change ownership of the temporary files Ansible ' 'Failed to change ownership of the temporary files Ansible '
'needs to create despite connecting as a privileged user. ' '(via chmod nor setfacl) needs to create despite connecting as a '
'Unprivileged become user would be unable to read the ' 'privileged user. Unprivileged become user would be unable to read'
'file.') ' the file.')
# Step 3d: Try macOS's special chmod + ACL # Step 3d: Try macOS's special chmod + ACL
# macOS chmod's +a flag takes its own argument. As a slight hack, we # macOS chmod's +a flag takes its own argument. As a slight hack, we

@ -427,7 +427,7 @@ class TestActionBase(unittest.TestCase):
'stderr': '', 'stderr': '',
} }
assertThrowRegex( assertThrowRegex(
'Failed to set file mode on remote temporary file', 'Failed to set file mode or acl on remote temporary files',
execute=True) execute=True)
action_base._remote_chmod.return_value = { action_base._remote_chmod.return_value = {
'rc': 0, 'rc': 0,

Loading…
Cancel
Save