0

What if I have a file on a Linux machine with user permissions of rw but assigned that user rwx permissions via ACL?

Will the ACL override that default user permissions and allow execute access?

nick@nick-XPS-9315:~$ cd /tmp
nick@nick-XPS-9315:/tmp$ touch test
nick@nick-XPS-9315:/tmp$ ll test
-rw-rw-r-- 1 nick nick 1210 Aug 11 09:37 test
nick@nick-XPS-9315:/tmp$ setfacl -m u:nick:rwx ./test
nick@nick-XPS-9315:/tmp$ ll test
-rw-rwxr--+ 1 nick nick 1210 Aug 11 09:37 test*
nick@nick-XPS-9315:/tmp$ getfacl test
# file: test
# owner: nick
# group: nick
user::rw-
user:nick:rwx
group::rw-
mask::rwx
other::r--
terdon
  • 234,489
  • 66
  • 447
  • 667
  • Have you tried it by giving account foo the permissions you're suggesting? – doneal24 Aug 11 '23 at 15:57
  • I found the answer, there's a hierarchy or permissions I posted below, it's not as simple as ACL vs chmod. – Nick Kiermaier Aug 11 '23 at 16:00
  • 4
    Does this answer your question? [Precedence of user and group owner in file permissions](https://unix.stackexchange.com/questions/134332/precedence-of-user-and-group-owner-in-file-permissions). Check the accepted answer it goes into detail about what happens with ACLs. – Eduardo Trápani Aug 11 '23 at 16:30

1 Answers1

0

I found a permissions hierarchy.

  • System immediately stops when finds a match at any step and does not proceed further.
  1. Is user owner? uses the user owner chmod permissions
  2. Any user ACLs? Unions ACL permissions and uses those ACL permissions
  3. Is group owner? uses the group owner chmod permissions
  4. Any group ACL's? Unions those ACL group permissions and uses those ACL permissions
  5. Get permissions of others entity