diff options
author | Volker Lendecke <vl@samba.org> | 2009-02-27 11:18:35 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-02-27 11:20:17 +0100 |
commit | 62db0ea0cfe215b83f7ec94b77f10ef49175c7ae (patch) | |
tree | f753a7e9628f9f49810566359e067c501df63797 /source3/registry | |
parent | 61bedb4263a73121bde3fb18295bc0abc4ccbcb2 (diff) | |
download | samba-62db0ea0cfe215b83f7ec94b77f10ef49175c7ae.tar.gz samba-62db0ea0cfe215b83f7ec94b77f10ef49175c7ae.tar.xz samba-62db0ea0cfe215b83f7ec94b77f10ef49175c7ae.zip |
Use talloc_tos() in regkey_access_check()
Diffstat (limited to 'source3/registry')
-rw-r--r-- | source3/registry/reg_dispatcher.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/source3/registry/reg_dispatcher.c b/source3/registry/reg_dispatcher.c index 106d38e9a53..f8c382536fa 100644 --- a/source3/registry/reg_dispatcher.c +++ b/source3/registry/reg_dispatcher.c @@ -161,7 +161,6 @@ bool regkey_access_check( REGISTRY_KEY *key, uint32 requested, uint32 *granted, SEC_DESC *sec_desc; NTSTATUS status; WERROR err; - TALLOC_CTX *mem_ctx; /* use the default security check if the backend has not defined its * own */ @@ -171,30 +170,20 @@ bool regkey_access_check( REGISTRY_KEY *key, uint32 requested, uint32 *granted, granted, token); } - /* - * The secdesc routines can't yet cope with a NULL talloc ctx sanely. - */ - - if (!(mem_ctx = talloc_init("regkey_access_check"))) { - return false; - } - - err = regkey_get_secdesc(mem_ctx, key, &sec_desc); + err = regkey_get_secdesc(talloc_tos(), key, &sec_desc); if (!W_ERROR_IS_OK(err)) { - TALLOC_FREE(mem_ctx); return false; } se_map_generic( &requested, ®_generic_map ); status =se_access_check(sec_desc, token, requested, granted); + TALLOC_FREE(sec_desc); if (!NT_STATUS_IS_OK(status)) { - TALLOC_FREE(mem_ctx); return false; } - TALLOC_FREE(mem_ctx); return NT_STATUS_IS_OK(status); } |