diff options
author | Günther Deschner <gd@samba.org> | 2009-07-17 13:44:55 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2009-07-17 13:50:34 +0200 |
commit | d1903cb7f2269c3eeb27ae05f734cbd8a542ee7f (patch) | |
tree | 6ec84160b7f0511ee6b4a8e4a81f635e9fe0dbbc /source3 | |
parent | 7e9f8f0f951912943208af8cdb47c6b733b0d82c (diff) | |
download | samba-d1903cb7f2269c3eeb27ae05f734cbd8a542ee7f.tar.gz samba-d1903cb7f2269c3eeb27ae05f734cbd8a542ee7f.tar.bz2 samba-d1903cb7f2269c3eeb27ae05f734cbd8a542ee7f.zip |
s3-lsa: Fix policy handle memleak and handle type check in _lsa_DeleteObject().
Guenther
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/srv_lsa_nt.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c index 1a6d3bae16..50bafc9349 100644 --- a/source3/rpc_server/srv_lsa_nt.c +++ b/source3/rpc_server/srv_lsa_nt.c @@ -1304,12 +1304,22 @@ NTSTATUS _lsa_DeleteObject(pipes_struct *p, return NT_STATUS_ACCESS_DENIED; } - status = privilege_delete_account(&info->sid); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(10,("_lsa_DeleteObject: privilege_delete_account gave: %s\n", - nt_errstr(status))); + switch (info->type) { + case LSA_HANDLE_ACCOUNT_TYPE: + status = privilege_delete_account(&info->sid); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(10,("_lsa_DeleteObject: privilege_delete_account gave: %s\n", + nt_errstr(status))); + return status; + } + break; + default: + return NT_STATUS_INVALID_HANDLE; } + close_policy_hnd(p, r->in.handle); + ZERO_STRUCTP(r->out.handle); + return status; } |