r3918: Allow to set OWNER- and GROUP-entries while setting security descriptors
authorGünther Deschner <gd@samba.org>
Tue, 23 Nov 2004 01:05:31 +0000 (01:05 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:24 +0000 (10:53 -0500)
with smbcacls and using with the -S or -M switch. Fixes #404 and #2076.

Guenther
(This used to be commit 13d32519e3806d7c080a0ac3c5ba196868ed2581)

source3/utils/smbcacls.c

index f40789b6662fb5df8311d9f037ea4f8e6eb22ed7..b12bf4d35d84fd361987bb128c139734e1095039 100644 (file)
@@ -657,6 +657,14 @@ static int cacl_set(struct cli_state *cli, char *filename,
                        }
                }
 
+               if (sd->owner_sid) {
+                       old->owner_sid = sd->owner_sid;
+               }
+
+               if (sd->grp_sid) { 
+                       old->grp_sid = sd->grp_sid;
+               }
+
                break;
 
        case SMB_ACL_ADD:
@@ -674,7 +682,7 @@ static int cacl_set(struct cli_state *cli, char *filename,
        sort_acl(old->dacl);
 
        /* Create new security descriptor and set it */
-       sd = make_sec_desc(ctx,old->revision, old->type, NULL, NULL,
+       sd = make_sec_desc(ctx,old->revision, old->type, old->owner_sid, old->grp_sid,
                           NULL, old->dacl, &sd_size);
 
        fnum = cli_nt_create(cli, filename, WRITE_DAC_ACCESS);