diff options
author | Jeremy Allison <jra@samba.org> | 2001-02-28 00:51:02 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-02-28 00:51:02 +0000 |
commit | 0f2799aaf1e33aa474a12b9389728d57af926cb3 (patch) | |
tree | e2cf9efcc996a3b8f08184e204e8af0810e7b8c9 /source3/lib/util_seaccess.c | |
parent | 545649a05f4d634bb93471bd946a92b1c5644684 (diff) | |
download | samba-0f2799aaf1e33aa474a12b9389728d57af926cb3.tar.gz samba-0f2799aaf1e33aa474a12b9389728d57af926cb3.tar.xz samba-0f2799aaf1e33aa474a12b9389728d57af926cb3.zip |
Move to talloc control of SPOOL_XXX structs. Move to talloc control of
security descriptors and pointers. Syncup with 2.2 tree.
Jeremy.
(This used to be commit 14d5997dc841e78a619e865288486d50c245896d)
Diffstat (limited to 'source3/lib/util_seaccess.c')
-rw-r--r-- | source3/lib/util_seaccess.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/source3/lib/util_seaccess.c b/source3/lib/util_seaccess.c index 6cfcd065aad..e1b18460e24 100644 --- a/source3/lib/util_seaccess.c +++ b/source3/lib/util_seaccess.c @@ -305,7 +305,7 @@ BOOL se_access_check(SEC_DESC *sd, struct current_user *user, the parent container. This child object can either be a container or non-container object. */ -SEC_DESC_BUF *se_create_child_secdesc(SEC_DESC *parent_ctr, +SEC_DESC_BUF *se_create_child_secdesc(TALLOC_CTX *ctx, SEC_DESC *parent_ctr, BOOL child_container) { SEC_DESC_BUF *sdb; @@ -321,7 +321,7 @@ SEC_DESC_BUF *se_create_child_secdesc(SEC_DESC *parent_ctr, acl = parent_ctr->dacl; - if (!(new_ace_list = malloc(sizeof(SEC_ACE) * acl->num_aces))) + if (!(new_ace_list = talloc(ctx, sizeof(SEC_ACE) * acl->num_aces))) return NULL; for (i = 0; acl && i < acl->num_aces; i++) { @@ -398,24 +398,19 @@ SEC_DESC_BUF *se_create_child_secdesc(SEC_DESC *parent_ctr, /* Create child security descriptor to return */ - new_dacl = make_sec_acl(ACL_REVISION, new_ace_list_ndx, new_ace_list); - safe_free(new_ace_list); + new_dacl = make_sec_acl(ctx, ACL_REVISION, new_ace_list_ndx, new_ace_list); /* Use the existing user and group sids. I don't think this is correct. Perhaps the user and group should be passed in as parameters by the caller? */ - sd = make_sec_desc(SEC_DESC_REVISION, + sd = make_sec_desc(ctx, SEC_DESC_REVISION, parent_ctr->owner_sid, parent_ctr->grp_sid, parent_ctr->sacl, new_dacl, &size); - free_sec_acl(&new_dacl); - - sdb = make_sec_desc_buf(size, sd); - - free_sec_desc(&sd); + sdb = make_sec_desc_buf(ctx, size, sd); return sdb; } |