1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

acl: Fix X support in ACL permissions

If you try to set rwX permissions, ACL fails to set them at all.

Expected:

    $ sudo setfacl -m 'group::rwX' www
    ...
    drwxrwxr-x  2 root root  4096 Nov 10 17:09 www

With Ansible:

    acl: name=/var/www permissions=rwX etype=group state=present
    ...
    drwxrw-r-x  2 root root  4096 Nov 10 17:30 www

x for group is erased. =/
This commit is contained in:
anatoly techtonik 2014-11-10 20:32:05 +03:00 committed by Matt Clay
parent 6594a1458d
commit 59a700ad17

View file

@ -111,6 +111,9 @@ def normalize_permissions(p):
perms[1] = 'w' perms[1] = 'w'
if char == 'x': if char == 'x':
perms[2] = 'x' perms[2] = 'x'
if char == 'X':
if perms[2] != 'x': # 'x' is more permissive
perms[2] = 'X'
return ''.join(perms) return ''.join(perms)
def split_entry(entry): def split_entry(entry):