diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-10 12:15:26 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:08:38 -0500 |
commit | 577218b2aded7adb367f3f33bcc5560f3d4c0ec2 (patch) | |
tree | 353a1cad1840485225b0d25d08eae5ae4aa27e5c /source4/rpc_server/lsa | |
parent | 3136462ea9d2b97e5385386e2c37b1ac403db6ca (diff) | |
download | samba-577218b2aded7adb367f3f33bcc5560f3d4c0ec2.tar.gz samba-577218b2aded7adb367f3f33bcc5560f3d4c0ec2.tar.bz2 samba-577218b2aded7adb367f3f33bcc5560f3d4c0ec2.zip |
r4640: first stage in the server side support for multiple context_ids on one pipe
this stage does the following:
- simplifies the dcerpc_handle handling, and all the callers of it
- split out the context_id depenent state into a linked list of established contexts
- fixed some talloc handling in several rpc servers that i noticed while doing the above
(This used to be commit fde042b3fc609c94e2c7eedcdd72ecdf489cf63b)
Diffstat (limited to 'source4/rpc_server/lsa')
-rw-r--r-- | source4/rpc_server/lsa/dcesrv_lsa.c | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c index dd22834c01..752795b65b 100644 --- a/source4/rpc_server/lsa/dcesrv_lsa.c +++ b/source4/rpc_server/lsa/dcesrv_lsa.c @@ -65,24 +65,6 @@ struct lsa_account_state { }; -/* - destroy an open policy. This closes the database connection -*/ -static void lsa_Policy_destroy(struct dcesrv_connection *conn, struct dcesrv_handle *h) -{ - struct lsa_policy_state *state = h->data; - talloc_free(state); -} - -/* - destroy an open account. -*/ -static void lsa_Account_destroy(struct dcesrv_connection *conn, struct dcesrv_handle *h) -{ - struct lsa_account_state *astate = h->data; - talloc_free(astate); -} - /* lsa_Close */ @@ -95,10 +77,7 @@ static NTSTATUS lsa_Close(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ct DCESRV_PULL_HANDLE(h, r->in.handle, DCESRV_HANDLE_ANY); - /* this causes the callback samr_XXX_destroy() to be called by - the handle destroy code which destroys the state associated - with the handle */ - dcesrv_handle_destroy(dce_call->conn, h); + talloc_free(h); ZERO_STRUCTP(r->out.handle); @@ -278,13 +257,12 @@ static NTSTATUS lsa_OpenPolicy2(struct dcesrv_call_state *dce_call, TALLOC_CTX * return status; } - handle = dcesrv_handle_new(dce_call->conn, LSA_HANDLE_POLICY); + handle = dcesrv_handle_new(dce_call->context, LSA_HANDLE_POLICY); if (!handle) { return NT_STATUS_NO_MEMORY; } - handle->data = talloc_reference(handle, state); - handle->destroy = lsa_Policy_destroy; + handle->data = talloc_steal(handle, state); state->access_mask = r->in.access_mask; state->handle = handle; @@ -858,14 +836,13 @@ static NTSTATUS lsa_OpenAccount(struct dcesrv_call_state *dce_call, TALLOC_CTX * astate->policy = talloc_reference(astate, state); astate->access_mask = r->in.access_mask; - ah = dcesrv_handle_new(dce_call->conn, LSA_HANDLE_ACCOUNT); + ah = dcesrv_handle_new(dce_call->context, LSA_HANDLE_ACCOUNT); if (!ah) { talloc_free(astate); return NT_STATUS_NO_MEMORY; } - ah->data = astate; - ah->destroy = lsa_Account_destroy; + ah->data = talloc_steal(ah, astate); *r->out.acct_handle = ah->wire_handle; |