If a file have a regular permission of read for user John, and also have an ACL permission of write for user John, what would happen in this case:

  • Would the regular permissions only be applied (so the file would only have read permission)?
  • Or would the ACL permissions only be applied (so the file would only have write permission)?
  • Or would both permissions be applied (so the file would have both read and write permissions)?

Short answer

ACL is a superset of traditional, therefore you can't have both, (because the traditional are part of ACL).

Longer answer.

1st let us try it.

#> chmod ug-w aab
#> setfacl -m u:me:w aab
#> getfacl aab
# file: aab
# owner: me
# group: me
user:me:-w-                #effective:---

So why is the ACL of user:me ineffective.

To explain this we can look at traditional permissions.

If we have a file as listed here

-r---w----  1 me me    0 Feb 21 09:41 abc

Then I can read it, but I can not write to it. Why is this.

The OS first tries to match me to the owner, then the group, then to other. It matches me to owner. It then applies these permissions. It does not then merge my group permissions.

With ACLs the extra permissions are all part of the group permission, so will not be use for the owner.

I think ACLs are parsed in the same way: find what user group you are in, then apply this permission. (No permission merging).

If the users differ

If we did #> setfacl -m u:anotherUser:w aab, then you permission will apply, as this permission is found first (for this user), and it is applied.

  • It may be useful to point out what happens if the user is not the owner of the file, but a member of the group owner of the file. – gerlos Feb 21 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.