Author: gd Date: 2004-11-23 01:05:31 +0000 (Tue, 23 Nov 2004) New Revision: 3918
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3918 Log: Allow to set OWNER- and GROUP-entries while setting security descriptors with smbcacls and using with the -S or -M switch. Fixes #404 and #2076. Guenther Modified: branches/SAMBA_3_0/source/utils/smbcacls.c trunk/source/utils/smbcacls.c Changeset: Modified: branches/SAMBA_3_0/source/utils/smbcacls.c =================================================================== --- branches/SAMBA_3_0/source/utils/smbcacls.c 2004-11-23 00:31:00 UTC (rev 3917) +++ branches/SAMBA_3_0/source/utils/smbcacls.c 2004-11-23 01:05:31 UTC (rev 3918) @@ -657,6 +657,14 @@ } } + 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 @@ 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); Modified: trunk/source/utils/smbcacls.c =================================================================== --- trunk/source/utils/smbcacls.c 2004-11-23 00:31:00 UTC (rev 3917) +++ trunk/source/utils/smbcacls.c 2004-11-23 01:05:31 UTC (rev 3918) @@ -657,6 +657,14 @@ } } + 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 @@ 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);