I'm trying to use setfacl
to set the permissions of different ZFS datasets, and I want those ACL permissions equivalent to UNIX-style chmod 770
.
What setfacl
command could accomplish this, and what ACLs should getfacl
display if I were to do this correctly?
I'm running FreeNAS 11.0 with Samba 4.6.4.
Note: the following is from a Solaris system, but the results should also work on BSD (where you need to use
getfacl
/setfacl
instead ofls
/chmod
).The default permissions of a newly created (text) file are:
If you use
chmod 0770 /path/to/file
, you will get:Essentially, execute (x) is added for owner and group, read (r) is removed from everyone, and write (w) and append (p) are added to group.
For a directory, it looks as follows:
And after modification:
Here, read (r) and execute (x) are removed from everyone, while owner and group have the same permissions as in the file case, although with added delete_child (D) permission (this comes from being a directory).