Modifying ACL Inheritance With the ACL Inherit Mode
This section describes the aclinherit
property values.
Example 2-4 ACL Inheritance With the ACL Inherit Mode Set to discard
If the aclinherit
property on a file system is set to discard
, then ACLs can potentially be discarded when the permission bits on a directory change. For example:
$ pfbash ; zfs set aclinherit=discard system1/cindy $ chmod A+user:alice:read_data/write_data/execute:dir_inherit:allow test5.dir $ ls -dv test5.dir drwxr-xr-x+ 2 root root 2 Jul 20 14:18 test5.dir 0:user:alice:list_directory/read_data/add_file/write_data/execute :dir_inherit:allow 1:owner@:list_directory/read_data/add_file/write_data/add_subdirectory /append_data/read_xattr/write_xattr/execute/delete_child /read_attributes/write_attributes/read_acl/write_acl/write_owner /synchronize:allow 2:group@:list_directory/read_data/read_xattr/execute/read_attributes /read_acl/synchronize:allow 3:everyone@:list_directory/read_data/read_xattr/execute/read_attributes /read_acl/synchronize:allow
If, at a later time, you decide to tighten the permission bits on a directory, the non-trivial ACL is discarded. For example:
$ pfexec chmod 744 test5.dir $ ls -dv test5.dir drwxr--r-- 2 root root 2 Jul 20 14:18 test5.dir 0:owner@:list_directory/read_data/add_file/write_data/add_subdirectory /append_data/read_xattr/write_xattr/execute/delete_child /read_attributes/write_attributes/read_acl/write_acl/write_owner /synchronize:allow 1:group@:list_directory/read_data/read_xattr/read_attributes/read_acl /synchronize:allow 2:everyone@:list_directory/read_data/read_xattr/read_attributes/read_acl /synchronize:allow
Example 2-5 ACL Inheritance With the ACL Inherit Mode Set to noallow
In the following example, two non-trivial ACLs with file inheritance are set. One ACL allows read_data
permission, and one ACL denies read_data
permission. This example also illustrates how you can specify two ACEs in the same chmod
command.
$ pfbash ; zfs set aclinherit=noallow system1/cindy $ chmod A+user:alice:read_data:file_inherit:deny,user:lp:read_data:file_inherit:allow test6.dir $ ls -dv test6.dir drwxr-xr-x+ 2 root root 2 Jul 20 14:22 test6.dir 0:user:alice:read_data:file_inherit:deny 1:user:lp:read_data:file_inherit:allow 2:owner@:list_directory/read_data/add_file/write_data/add_subdirectory /append_data/read_xattr/write_xattr/execute/delete_child /read_attributes/write_attributes/read_acl/write_acl/write_owner /synchronize:allow 3:group@:list_directory/read_data/read_xattr/execute/read_attributes /read_acl/synchronize:allow 4:everyone@:list_directory/read_data/read_xattr/execute/read_attributes /read_acl/synchronize:allow
As the following example shows, when a new file is created, the ACL that allows read_data
permission is discarded.
$ touch test6.dir/file.6 $ ls -v test6.dir/file.6 -rw-r--r--+ 1 root root 0 Jul 20 14:23 test6.dir/file.6 0:user:alice:read_data:inherited:deny 1:owner@:read_data/write_data/append_data/read_xattr/write_xattr /read_attributes/write_attributes/read_acl/write_acl/write_owner /synchronize:allow 2:group@:read_data/read_xattr/read_attributes/read_acl/synchronize:allow 3:everyone@:read_data/read_xattr/read_attributes/read_acl/synchronize :allow