summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/printing/nt_printing.c4
-rw-r--r--source3/rpc_client/cli_reg.c2
-rw-r--r--source3/rpc_parse/parse_sec.c14
3 files changed, 9 insertions, 11 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index af2be89e23..1ffc926472 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -2693,7 +2693,6 @@ uint32 nt_printing_setsec(char *printername, SEC_DESC_BUF *secdesc_ctr)
/* Make a deep copy of the security descriptor */
psd = make_sec_desc(secdesc_ctr->sec->revision,
- secdesc_ctr->sec->type,
owner_sid, group_sid,
sacl,
dacl,
@@ -2800,8 +2799,6 @@ static SEC_DESC_BUF *construct_default_printer_sdb(void)
if ((psa = make_sec_acl(NT4_ACL_REVISION, 2, ace)) != NULL) {
psd = make_sec_desc(SEC_DESC_REVISION,
- SEC_DESC_SELF_RELATIVE |
- SEC_DESC_DACL_PRESENT,
&owner_sid, NULL,
NULL, psa, &sd_size);
free_sec_acl(&psa);
@@ -2874,7 +2871,6 @@ BOOL nt_printing_getsec(char *printername, SEC_DESC_BUF **secdesc_ctr)
sid_append_rid(&owner_sid, DOMAIN_USER_RID_ADMIN);
psd = make_sec_desc((*secdesc_ctr)->sec->revision,
- (*secdesc_ctr)->sec->type,
&owner_sid,
(*secdesc_ctr)->sec->grp_sid,
(*secdesc_ctr)->sec->sacl,
diff --git a/source3/rpc_client/cli_reg.c b/source3/rpc_client/cli_reg.c
index 13a9b26515..b45ac0d033 100644
--- a/source3/rpc_client/cli_reg.c
+++ b/source3/rpc_client/cli_reg.c
@@ -708,7 +708,7 @@ BOOL do_reg_create_key(struct cli_state *cli, POLICY_HND *hnd,
DEBUG(4,("REG Create Key: %s %s 0x%08x\n", key_name, key_class,
sam_access != NULL ? sam_access->mask : 0));
- if((sec = make_sec_desc( 1, SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL, NULL, &sec_len)) == NULL) {
+ if((sec = make_sec_desc( 1, NULL, NULL, NULL, NULL, &sec_len)) == NULL) {
DEBUG(0,("make_sec_desc : malloc fail.\n"));
return False;
}
diff --git a/source3/rpc_parse/parse_sec.c b/source3/rpc_parse/parse_sec.c
index 39ead58126..2d4f745380 100644
--- a/source3/rpc_parse/parse_sec.c
+++ b/source3/rpc_parse/parse_sec.c
@@ -419,12 +419,11 @@ SEC_DESC_BUF *sec_desc_merge(SEC_DESC_BUF *new_sdb, SEC_DESC_BUF *old_sdb)
dacl = new_sdb->sec->dacl;
} else {
dacl = old_sdb->sec->dacl;
- secdesc_type |= SEC_DESC_DACL_PRESENT;
}
/* Create new security descriptor from bits */
- psd = make_sec_desc(new_sdb->sec->revision, secdesc_type,
+ psd = make_sec_desc(new_sdb->sec->revision,
owner_sid, group_sid, sacl, dacl, &secdesc_size);
return_sdb = make_sec_desc_buf(secdesc_size, psd);
@@ -438,7 +437,7 @@ SEC_DESC_BUF *sec_desc_merge(SEC_DESC_BUF *new_sdb, SEC_DESC_BUF *old_sdb)
Creates a SEC_DESC structure
********************************************************************/
-SEC_DESC *make_sec_desc(uint16 revision, uint16 type,
+SEC_DESC *make_sec_desc(uint16 revision,
DOM_SID *owner_sid, DOM_SID *grp_sid,
SEC_ACL *sacl, SEC_ACL *dacl, size_t *sd_size)
{
@@ -453,7 +452,10 @@ SEC_DESC *make_sec_desc(uint16 revision, uint16 type,
ZERO_STRUCTP(dst);
dst->revision = revision;
- dst->type = type;
+ dst->type = SEC_DESC_SELF_RELATIVE;
+
+ if (sacl) dst->type |= SEC_DESC_SACL_PRESENT;
+ if (dacl) dst->type |= SEC_DESC_DACL_PRESENT;
dst->off_owner_sid = 0;
dst->off_grp_sid = 0;
@@ -535,7 +537,7 @@ SEC_DESC *dup_sec_desc( SEC_DESC *src)
if(src == NULL)
return NULL;
- return make_sec_desc( src->revision, src->type,
+ return make_sec_desc( src->revision,
src->owner_sid, src->grp_sid, src->sacl,
src->dacl, &dummy);
}
@@ -568,7 +570,7 @@ void free_sec_desc(SEC_DESC **ppsd)
SEC_DESC *make_standard_sec_desc(DOM_SID *owner_sid, DOM_SID *grp_sid,
SEC_ACL *dacl, size_t *sd_size)
{
- return make_sec_desc(SEC_DESC_REVISION, SEC_DESC_SELF_RELATIVE|SEC_DESC_DACL_PRESENT,
+ return make_sec_desc(SEC_DESC_REVISION,
owner_sid, grp_sid, NULL, dacl, sd_size);
}