summaryrefslogtreecommitdiff
path: root/source3/lib/sharesec.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-01-06 14:17:15 +0100
committerVolker Lendecke <vl@samba.org>2008-01-10 13:19:59 +0100
commit9f67ee6334f36f30ddfc2e86459cb764bccf1edf (patch)
treeec948db07a238feb849ad999bbce0c297851d530 /source3/lib/sharesec.c
parent5ddb2abf7611a93960056075ea56f992329c3678 (diff)
downloadsamba-9f67ee6334f36f30ddfc2e86459cb764bccf1edf.tar.gz
samba-9f67ee6334f36f30ddfc2e86459cb764bccf1edf.tar.bz2
samba-9f67ee6334f36f30ddfc2e86459cb764bccf1edf.zip
use talloc_tos() in share_access_check()
(This used to be commit ac2bb838d537ca563ad2fe770b3e1c2fe8b1d9e7)
Diffstat (limited to 'source3/lib/sharesec.c')
-rw-r--r--source3/lib/sharesec.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/source3/lib/sharesec.c b/source3/lib/sharesec.c
index ba025dacc1..f6ff701d5b 100644
--- a/source3/lib/sharesec.c
+++ b/source3/lib/sharesec.c
@@ -228,25 +228,20 @@ bool share_access_check(const NT_USER_TOKEN *token, const char *sharename,
{
uint32 granted;
NTSTATUS status;
- TALLOC_CTX *mem_ctx = NULL;
SEC_DESC *psd = NULL;
size_t sd_size;
bool ret = True;
- if (!(mem_ctx = talloc_init("share_access_check"))) {
- return False;
- }
-
- psd = get_share_security(mem_ctx, sharename, &sd_size);
+ psd = get_share_security(talloc_tos(), sharename, &sd_size);
if (!psd) {
- TALLOC_FREE(mem_ctx);
return True;
}
ret = se_access_check(psd, token, desired_access, &granted, &status);
- talloc_destroy(mem_ctx);
+ TALLOC_FREE(psd);
+
return ret;
}