vfs/nfs4_acls: move special handling of SMB_ACE4_SYNCHRONIZE to vfs_zfsacl
authorRalph Boehme <slow@samba.org>
Wed, 6 Sep 2017 14:28:10 +0000 (16:28 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 8 Sep 2017 23:07:17 +0000 (01:07 +0200)
Commit 99a74ff5e6a9f87ad7a650cb44e0f925f834b3a1 added special handling
of SMB_ACE4_SYNCHRONIZE, always setting it in the access_mask when
fabricating an ACL. While at the same time removing it from the
access_mask when setting an ACL, but this is done direclty in
vfs_zfsacl, not it the common code.

Forcing SMB_ACE4_SYNCHRONIZE to be always set is only needed on ZFS, the
other VFS modules using the common NFSv4 infrastructure should not be
made victims of the special ZFS behaviour.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=7909

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/nfs4_acls.c
source3/modules/vfs_zfsacl.c

index 7488b1c9606d47baffad16731898c84cf1146b45..78861f5df6275aee9345ba632b6911877ac495c7 100644 (file)
@@ -386,13 +386,6 @@ static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx,
                      ace->aceFlags, win_ace_flags));
 
                mask = ace->aceMask;
-               /* Windows clients expect SYNC on acls to
-                  correctly allow rename. See bug #7909. */
-               /* But not on DENY ace entries. See
-                  bug #8442. */
-               if(ace->aceType == SMB_ACE4_ACCESS_ALLOWED_ACE_TYPE) {
-                       mask = ace->aceMask | SMB_ACE4_SYNCHRONIZE;
-               }
 
                /* Mapping of owner@ and group@ to creator owner and
                   creator group. Keep old behavior in mode special. */
index 76cf5281af78303295b7f971e40803e9916ce0f7..4cb1b98f01b2c450d3a6f73d3216edd9067b55ef 100644 (file)
@@ -84,6 +84,15 @@ static NTSTATUS zfs_get_nt_acl_common(TALLOC_CTX *mem_ctx,
                aceprop.aceMask  = (uint32_t) acebuf[i].a_access_mask;
                aceprop.who.id   = (uint32_t) acebuf[i].a_who;
 
+               /*
+                * Windows clients expect SYNC on acls to correctly allow
+                * rename, cf bug #7909. But not on DENY ace entries, cf bug
+                * #8442.
+                */
+               if (aceprop.aceType == SMB_ACE4_ACCESS_ALLOWED_ACE_TYPE) {
+                       aceprop.aceMask |= SMB_ACE4_SYNCHRONIZE;
+               }
+
                if(aceprop.aceFlags & ACE_OWNER) {
                        aceprop.flags = SMB_ACE4_ID_SPECIAL;
                        aceprop.who.special_id = SMB_ACE4_WHO_OWNER;