Don't call FSET_NT_ACL on file create if there's no SD to set. Leave the default...
authorJeremy Allison <jra@samba.org>
Thu, 6 Nov 2008 09:40:21 +0000 (01:40 -0800)
committerJeremy Allison <jra@samba.org>
Thu, 6 Nov 2008 09:40:21 +0000 (01:40 -0800)
Jeremy.

source3/modules/vfs_acl_xattr.c
source3/smbd/open.c

index 9d9ea01375375c6f1b6ecab53570dc3fa97952ed..c6fb0b5907caf46980c011a03033806714296957 100644 (file)
@@ -528,10 +528,6 @@ static NTSTATUS fset_nt_acl_xattr(vfs_handle_struct *handle, files_struct *fsp,
                        CONST_DISCARD(struct security_descriptor *,psd));
        }
 
-       if (!psd->owner_sid && !psd->group_sid && !(psd->type & SEC_DESC_DACL_PRESENT)) {
-               return NT_STATUS_OK;
-       }
-
        status = SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
index 480352bedaaa256150b7df293f729ad179e4c591..3fd0d1a03a49e4981373001f56de59b10501402f 100644 (file)
@@ -2923,7 +2923,12 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
                security_acl_map_generic(sd->dacl, &file_generic_mapping);
                security_acl_map_generic(sd->sacl, &file_generic_mapping);
 
-               status = SMB_VFS_FSET_NT_ACL(fsp, sec_info_sent, sd);
+               if (sec_info_sent & (OWNER_SECURITY_INFORMATION|
+                                       GROUP_SECURITY_INFORMATION|
+                                       DACL_SECURITY_INFORMATION|
+                                       SACL_SECURITY_INFORMATION)) {
+                       status = SMB_VFS_FSET_NT_ACL(fsp, sec_info_sent, sd);
+               }
 
                fsp->access_mask = saved_access_mask;