vfs_zfsacl: only grant DELETE_CHILD if ACL tag is special
commite1f7e422bd560196f735c96e6bf6d84524d169a7
authorAndrew Walker <awalker@ixsystems.com>
Thu, 24 Sep 2020 20:04:12 +0000 (24 16:04 -0400)
committerKarolin Seeger <kseeger@samba.org>
Fri, 30 Oct 2020 13:54:18 +0000 (30 13:54 +0000)
tree7b8ad28b89a31175934799889db7326c8967cc13
parente14dfa439e720719fbb4ff7ab8265e4a59c81278
vfs_zfsacl: only grant DELETE_CHILD if ACL tag is special

When ZFS aclmode is set to "passthrough" chmod(2)/fchmod(2) will result
in special entries being modified in a way such that delete, delete_child,
write_named_attr, write_attribute are stripped from the returned ACL entry,
and the kernel / ZFS treats this as having rights equivalent to the desired
POSIX mode. Historically, samba has added delete_child to the NFSv4 ACL, but
this is only really called for in the case of special entries in this
particular circumstance.

Alter circumstances in which delete_child is granted so that it only
is added to special entries. This preserves the intend post-chmod behavior,
but avoids unnecessarily increasing permissions in cases where it's not
intended. Further modification of this behavior may be required so that
we grant a general read or general write permissions set in case of
POSIX read / POSIX write on special entries.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14471
RN: vfs_zfsacl: only grant DELETE_CHILD if ACL tag is special

Signed-off-by: Andrew Walker <awalker@ixsystems.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit c1a37b4f31d5252ce074d41f69e526aa84b0d3b3)
source3/modules/vfs_zfsacl.c