]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Change the other two places where we set a security descriptor given by the client...
authorJeremy Allison <jra@samba.org>
Wed, 29 Aug 2012 23:52:02 +0000 (16:52 -0700)
committerKarolin Seeger <kseeger@samba.org>
Fri, 31 Aug 2012 06:46:17 +0000 (08:46 +0200)
source3/rpc_server/srvsvc/srv_srvsvc_nt.c
source3/smbd/open.c

index a078395b2fea413a334ff087a616abf92bd7ee3d..b9345d6428b134974d52b9033da742acfc3da294 100644 (file)
@@ -2318,26 +2318,7 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p,
        psd = r->in.sd_buf->sd;
        security_info_sent = r->in.securityinformation;
 
-       if (psd->owner_sid==0) {
-               security_info_sent &= ~SECINFO_OWNER;
-       }
-       if (psd->group_sid==0) {
-               security_info_sent &= ~SECINFO_GROUP;
-       }
-       if (psd->sacl==0) {
-               security_info_sent &= ~SECINFO_SACL;
-       }
-       if (psd->dacl==0) {
-               security_info_sent &= ~SECINFO_DACL;
-       }
-
-       /* Convert all the generic bits. */
-       security_acl_map_generic(psd->dacl, &file_generic_mapping);
-       security_acl_map_generic(psd->sacl, &file_generic_mapping);
-
-       nt_status = SMB_VFS_FSET_NT_ACL(fsp,
-                                       security_info_sent,
-                                       psd);
+       nt_status = set_sd(fsp, psd, security_info_sent);
 
        if (!NT_STATUS_IS_OK(nt_status) ) {
                DEBUG(3,("_srvsvc_NetSetFileSecurity: Unable to set NT ACL "
index 72b7d8e42d292117bdad1b2d81ad61f012f79602..3100ad018766698103accca36f67f3819b6cb79e 100644 (file)
@@ -3363,15 +3363,11 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
 
                fsp->access_mask = FILE_GENERIC_ALL;
 
-               /* Convert all the generic bits. */
-               security_acl_map_generic(sd->dacl, &file_generic_mapping);
-               security_acl_map_generic(sd->sacl, &file_generic_mapping);
-
                if (sec_info_sent & (SECINFO_OWNER|
                                        SECINFO_GROUP|
                                        SECINFO_DACL|
                                        SECINFO_SACL)) {
-                       status = SMB_VFS_FSET_NT_ACL(fsp, sec_info_sent, sd);
+                       status = set_sd(fsp, sd, sec_info_sent);
                }
 
                fsp->access_mask = saved_access_mask;