s4:lsa RPC server - Fix up "dcesrv_lsa_DeleteObject"
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 28 Jun 2010 09:05:59 +0000 (11:05 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 28 Jun 2010 12:51:08 +0000 (14:51 +0200)
- 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

index 57c73e49611efd68a8fba852be19c4ab384e7042..85fddf7d30abba739f04fe8ef9d075aeedf80910 100644 (file)
@@ -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;