From 4826fdf95f68b63e5d35e13f8d033db0d0949587 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Matthias=20Dieter=20Walln=C3=B6fer?= Date: Mon, 28 Jun 2010 11:05:59 +0200 Subject: [PATCH] s4:lsa RPC server - Fix up "dcesrv_lsa_DeleteObject" - Return always "NT_STATUS_OK" on success - Remove "talloc_free"s on handles since the frees are automatically performed by the DCE/RPC server code --- source4/rpc_server/lsa/dcesrv_lsa.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c index 57c73e4961..85fddf7d30 100644 --- a/source4/rpc_server/lsa/dcesrv_lsa.c +++ b/source4/rpc_server/lsa/dcesrv_lsa.c @@ -186,13 +186,12 @@ static NTSTATUS dcesrv_lsa_DeleteObject(struct dcesrv_call_state *dce_call, TALL case SECURITY_ADMINISTRATOR: break; default: - /* Users and annonymous are not allowed delete things */ + /* Users and anonymous are not allowed to delete things */ return NT_STATUS_ACCESS_DENIED; } ret = ldb_delete(secret_state->sam_ldb, secret_state->secret_dn); - talloc_free(h); if (ret != LDB_SUCCESS) { return NT_STATUS_INVALID_HANDLE; } @@ -200,6 +199,7 @@ static NTSTATUS dcesrv_lsa_DeleteObject(struct dcesrv_call_state *dce_call, TALL ZERO_STRUCTP(r->out.handle); return NT_STATUS_OK; + } else if (h->wire_handle.handle_type == LSA_HANDLE_TRUSTED_DOMAIN) { struct lsa_trusted_domain_state *trusted_domain_state = talloc_get_type(h->data, struct lsa_trusted_domain_state); @@ -228,10 +228,11 @@ static NTSTATUS dcesrv_lsa_DeleteObject(struct dcesrv_call_state *dce_call, TALL if (ret != LDB_SUCCESS) { return NT_STATUS_INTERNAL_DB_CORRUPTION; } - talloc_free(h); + ZERO_STRUCTP(r->out.handle); return NT_STATUS_OK; + } else if (h->wire_handle.handle_type == LSA_HANDLE_ACCOUNT) { struct lsa_RightSet *rights; struct lsa_account_state *astate; @@ -272,6 +273,8 @@ static NTSTATUS dcesrv_lsa_DeleteObject(struct dcesrv_call_state *dce_call, TALL } ZERO_STRUCTP(r->out.handle); + + return NT_STATUS_OK; } return NT_STATUS_INVALID_HANDLE; -- 2.34.1