summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-11-02 02:35:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:18 -0500
commitaf3b6bec1f27ccbacde93b5dd54305c2fd40ef0e (patch)
tree0207fca0e172fabfae6f0a7434baf67f77f9a680 /source3/utils
parenta306447aa4bc1c4f66bba58a8a1091426cc3ccce (diff)
downloadsamba-af3b6bec1f27ccbacde93b5dd54305c2fd40ef0e.tar.gz
samba-af3b6bec1f27ccbacde93b5dd54305c2fd40ef0e.tar.bz2
samba-af3b6bec1f27ccbacde93b5dd54305c2fd40ef0e.zip
r11464: Allow smbcacls to modify a SD on W2K3. This may fix several
bugzilla bugs - I need to go through and check. I also need to test against WNT/W2K and WXP. Jeremy. (This used to be commit 881dd7dbf6de0e11a3703afd2a1ba286ff0d62ad)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/smbcacls.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index 01ca54c649..26037f643e 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -718,11 +718,24 @@ static int cacl_set(struct cli_state *cli, char *filename,
sort_acl(old->dacl);
/* Create new security descriptor and set it */
+#if 0
+ /* We used to just have "WRITE_DAC_ACCESS" without WRITE_OWNER.
+ But if we're sending an owner, even if it's the same as the one
+ that already exists then W2K3 insists we open with WRITE_OWNER access.
+ I need to check that setting a SD with no owner set works against WNT
+ and W2K. JRA.
+ */
+
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);
+ fnum = cli_nt_create(cli, filename, WRITE_DAC_ACCESS|WRITE_OWNER_ACCESS);
+#else
+ sd = make_sec_desc(ctx,old->revision, old->type, NULL, NULL,
+ NULL, old->dacl, &sd_size);
+ fnum = cli_nt_create(cli, filename, WRITE_DAC_ACCESS);
+#endif
if (fnum == -1) {
printf("cacl_set failed to open %s: %s\n", filename, cli_errstr(cli));
return EXIT_FAILED;