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
reviewable/pr18780/r1
Jérémie Astori 9 years ago
parent 3ac990556d
commit e95bcaeb8a

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

Loading…
Cancel
Save