8000 fix(acl): correctly assert needed changes when recursive is true by Silejonu · Pull Request #638 · ansible-collections/ansible.posix · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(acl): correctly assert needed changes when recursive is true #638

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/638_fix_recursive_acl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- acl - correctly assert needed changes when pointing to a directory and recursive is set to true.
10 changes: 5 additions & 5 deletions plugins/modules/acl.py
7DB4
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,16 @@ def acl_changed(module, cmd, entry, use_nfsv4_acls=False):
lines = run_acl(module, cmd)
counter = 0
for line in lines:
if line.endswith('*,*') and not use_nfsv4_acls:
return False
if not use_nfsv4_acls and not line.endswith('*,*'):
return True
# if use_nfsv4_acls and entry is listed
if use_nfsv4_acls and entry == line:
counter += 1

# The current 'nfs4_setfacl --test' lists a new entry,
# which will be added at the top of list, followed by the existing entries.
# So if the entry has already been registered, the entry should be find twice.
if counter == 2:
# which will be added at the top of the list, followed by the existing entries.
# So if the entry has already been registered, the entry should be found twice.
if not use_nfsv4_acls or counter == 2:
return False
return True

Expand Down
0