]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_acl_xattr: avoid removing the ACL xattr
authorRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 14:42:46 +0000 (15:42 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Dec 2020 18:56:29 +0000 (18:56 +0000)
...when called as part of setting a new NT ACL.

This depends on the previous code changes, so
won't be back ported. But for reference the
bug id is below.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14592

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

index 03c3b24866a756e499481f6b92357ae39671a510..f5a26ec55924bc9e36383ed51e7795ab29d64914 100644 (file)
@@ -228,6 +228,8 @@ static int sys_acl_set_fd_xattr(vfs_handle_struct *handle,
                                SMB_ACL_TYPE_T type,
                                SMB_ACL_T theacl)
 {
+       struct acl_common_fsp_ext *ext = (struct acl_common_fsp_ext *)
+               VFS_FETCH_FSP_EXTENSION(handle, fsp);
        int ret;
 
        ret = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle,
@@ -238,11 +240,15 @@ static int sys_acl_set_fd_xattr(vfs_handle_struct *handle,
                return -1;
        }
 
+       if (ext != NULL && ext->setting_nt_acl) {
+               return 0;
+       }
+
        become_root();
        SMB_VFS_FREMOVEXATTR(fsp, XATTR_NTACL_NAME);
        unbecome_root();
 
-       return ret;
+       return 0;
 }
 
 static int connect_acl_xattr(struct vfs_handle_struct *handle,