summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-11-06 01:40:21 -0800
committerJeremy Allison <jra@samba.org>2008-11-06 01:40:21 -0800
commit24c598b1b95742961d43ff5bd61831405b561dfe (patch)
tree65cb63535ff2ac3a74e7a274ff6a73c198b93dd7
parent4af3c2830ab61e2c93faf41a7472d6132687c7c3 (diff)
downloadsamba-24c598b1b95742961d43ff5bd61831405b561dfe.tar.gz
samba-24c598b1b95742961d43ff5bd61831405b561dfe.tar.xz
samba-24c598b1b95742961d43ff5bd61831405b561dfe.zip
Don't call FSET_NT_ACL on file create if there's no SD to set. Leave the default ACL in place.
Jeremy.
-rw-r--r--source3/modules/vfs_acl_xattr.c4
-rw-r--r--source3/smbd/open.c7
2 files changed, 6 insertions, 5 deletions
diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c
index 9d9ea01375..c6fb0b5907 100644
--- a/source3/modules/vfs_acl_xattr.c
+++ b/source3/modules/vfs_acl_xattr.c
@@ -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;
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 480352beda..3fd0d1a03a 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -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;