I think the answer is "That's just how it works," but I figured I'd ask in case I'm doing something wrong.
My account's default umask is 0077
. I'm in the wheel
group.
I have a directory with this ACL:
# file: .
# owner: root
# group: wheel
# flags: -s-
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:group:wheel:rwx
default:mask::rwx
default:other::r-x
I create a file, and the permissions are properly set according to the above ACL.
$ touch z
$ ls -al
drwxrwsr-x+ 2 root wheel 4,096 Aug 7 12:36 .
drwxr-xr-x. 7 root root 4,096 Aug 6 17:31 ..
-rw-rw-r--+ 1 ehymowitz wheel 0 Aug 7 12:36 z
I now decide that this is an executable, so I change the permissions. This time, it does not follow the ACL, it follows the umask.
$ chmod +x z
$ ls -al
drwxrwsr-x+ 2 root wheel 4,096 Aug 7 12:36 .
drwxr-xr-x. 7 root root 4,096 Aug 6 17:31 ..
-rwxrw-r--+ 1 ehymowitz wheel 0 Aug 7 12:36 z
I need to specify a+x
to make this work.
$ chmod a+x z
$ ls -al
drwxrwsr-x+ 2 root wheel 4,096 Aug 7 12:36 .
drwxr-xr-x. 7 root root 4,096 Aug 6 17:31 ..
-rwxrwxr-x+ 1 ehymowitz wheel 0 Aug 7 12:36 z
I guess I just don't understand why touch
creates a file according to the ACL, but chmod
adjusts the permissions ignoring the ACL.
chmod
is ACL agnostic, but note that "Windows" uses the modernACEs
not the withdrawnACLs
and as a result, Linux and Samba do not play well together since both systems are not 100% compatible. If you like uniform "ACL" handling in UNIX and Windows, you need aZFS
based fileserver that fully supportsNFSv4
. – schily Aug 07 '18 at 15:30