Remove support for `d[efault]:` in entry permissions

It is not documented in [the Ansible doc page][1] nor
[the BSD setfacl man entry][2] (which means it might not be compatible
with BSD) so removing it does not break the API.

On the other hand, it does not conform with POSIX 1003.1e DRAFT
STANDARD 17 according to the [Linux setfacl man entry][3] so safer to
remove.

Finally, the most important reason: in non POSIX 1003.e mode, only ACL
entries without the permissions field are accepted, so having an
optional field here is very much error-prone.

[1]: http://docs.ansible.com/ansible/acl_module.html
[2]: http://www.freebsd.org/cgi/man.cgi?format=html&query=setfacl(1)
[3]: http://linuxcommand.org/man_pages/setfacl1.html
pull/18777/head
Jérémie Astori 9 years ago committed by Matt Clay
parent ffbd1efaa7
commit a93445c798

@ -128,17 +128,12 @@ def split_entry(entry):
a = entry.split(':')
a.reverse()
if len(a) == 3:
a.append(False)
try:
p, e, t, d = a
p, e, t = a
except ValueError, e:
print "wtf?? %s => %s" % (entry, a)
raise e
if d:
d = True
if t.startswith("u"):
t = "user"
elif t.startswith("g"):
@ -150,7 +145,7 @@ def split_entry(entry):
else:
t = None
return [d, t, e, p]
return [t, e, p]
def build_entry(etype, entity, permissions=None):
@ -282,7 +277,7 @@ def main():
if state == 'absent' and entry.count(":") != 1:
module.fail_json(msg="'entry' MUST have 2 sections divided by ':' when 'state=absent'.")
default, etype, entity, permissions = split_entry(entry)
etype, entity, permissions = split_entry(entry)
changed = False
msg = ""

Loading…
Cancel
Save