summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2004-11-23 01:05:31 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:24 -0500
commit76a1bcd6557c8c4f95f7fe3a87a3561806ca54a0 (patch)
treed89fc9c211163e75c6540acdcf6a5e7e2a96293f /source3/utils
parent7e64659f65dc0e86711dd4cf5928681db1552544 (diff)
downloadsamba-76a1bcd6557c8c4f95f7fe3a87a3561806ca54a0.tar.gz
samba-76a1bcd6557c8c4f95f7fe3a87a3561806ca54a0.tar.bz2
samba-76a1bcd6557c8c4f95f7fe3a87a3561806ca54a0.zip
r3918: 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 (This used to be commit 13d32519e3806d7c080a0ac3c5ba196868ed2581)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/smbcacls.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index f40789b666..b12bf4d35d 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -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);