summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-09-13 22:01:15 +0000
committerJeremy Allison <jra@samba.org>2000-09-13 22:01:15 +0000
commit94028a54b289061ec7f0895bae99697c4b247bf4 (patch)
treeca0f23b43df5562a91bad9be4831c88e4d0c6838 /source3
parented6530800ccf4e8303bc7e106ca7443950fa27c9 (diff)
downloadsamba-94028a54b289061ec7f0895bae99697c4b247bf4.tar.gz
samba-94028a54b289061ec7f0895bae99697c4b247bf4.tar.bz2
samba-94028a54b289061ec7f0895bae99697c4b247bf4.zip
Ensure old DACL and SACL are preserved if the new SD is a 'set' only.
Jeremy. (This used to be commit 29f41d0d95661fbc31ae1d9669fd7fb439169f90)
Diffstat (limited to 'source3')
-rw-r--r--source3/printing/nt_printing.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 734cf7f8a8..255418a0ed 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -1982,6 +1982,7 @@ uint32 nt_printing_setsec(char *printername, SEC_DESC_BUF *secdesc_ctr)
if (!secdesc_ctr->sec->owner_sid || !secdesc_ctr->sec->grp_sid) {
DOM_SID *owner_sid, *group_sid;
+ SEC_ACL *dacl, *sacl;
SEC_DESC *psd = NULL;
size_t size;
@@ -1997,13 +1998,21 @@ uint32 nt_printing_setsec(char *printername, SEC_DESC_BUF *secdesc_ctr)
secdesc_ctr->sec->grp_sid :
old_secdesc_ctr->sec->grp_sid;
+ dacl = secdesc_ctr->sec->dacl ?
+ secdesc_ctr->sec->dacl :
+ old_secdesc_ctr->sec->dacl;
+
+ sacl = secdesc_ctr->sec->sacl ?
+ secdesc_ctr->sec->sacl :
+ old_secdesc_ctr->sec->sacl;
+
/* Make a deep copy of the security descriptor */
psd = make_sec_desc(secdesc_ctr->sec->revision,
secdesc_ctr->sec->type,
owner_sid, group_sid,
- secdesc_ctr->sec->sacl,
- secdesc_ctr->sec->dacl,
+ sacl,
+ dacl,
&size);
new_secdesc_ctr = make_sec_desc_buf(size, psd);