Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mention acl in permissions errors #79209

Merged
merged 2 commits into from Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/mention_acl.yml
@@ -0,0 +1,2 @@
bugfixes:
- updated error messages to include 'acl' and not just mode changes when failing to set required permissions on remote.
8 changes: 4 additions & 4 deletions lib/ansible/plugins/action/__init__.py
Expand Up @@ -674,7 +674,7 @@ def _fixup_perms2(self, remote_paths, remote_user=None, execute=True):
res = self._remote_chmod(remote_paths, 'u+x')
if res['rc'] != 0:
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(
res['rc'],
to_native(res['stderr'])))
Expand All @@ -689,9 +689,9 @@ def _fixup_perms2(self, remote_paths, remote_user=None, execute=True):
if remote_user in self._get_admin_users():
raise AnsibleError(
'Failed to change ownership of the temporary files Ansible '
'needs to create despite connecting as a privileged user. '
'Unprivileged become user would be unable to read the '
'file.')
'(via chmod nor setfacl) needs to create despite connecting as a '
'privileged user. Unprivileged become user would be unable to read'
' the file.')

# Step 3d: Try macOS's special chmod + ACL
# macOS chmod's +a flag takes its own argument. As a slight hack, we
Expand Down
2 changes: 1 addition & 1 deletion test/units/plugins/action/test_action.py
Expand Up @@ -427,7 +427,7 @@ def _helper(option, *args, **kwargs):
'stderr': '',
}
assertThrowRegex(
'Failed to set file mode on remote temporary file',
'Failed to set file mode or acl on remote temporary files',
execute=True)
action_base._remote_chmod.return_value = {
'rc': 0,
Expand Down