summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-10-21 15:18:59 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-10-21 22:43:56 +1100
commitfcbe6163f65ae9e4fce9228434c447ad34943010 (patch)
treeb0d6dedf577a58eb7e25375d6bd259815c4f78c3
parent108b8344db39f7314a7c4dcaf0fbd020d1b41da3 (diff)
downloadsamba-fcbe6163f65ae9e4fce9228434c447ad34943010.tar.gz
samba-fcbe6163f65ae9e4fce9228434c447ad34943010.tar.bz2
samba-fcbe6163f65ae9e4fce9228434c447ad34943010.zip
s4:samr Don't leak the whole user onto the long-term handle
The user entry is only required for this function, so use mem_ctx to hold it. Andrew Bartlett
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 6c5f5b845f..5b9aa91ded 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -1296,7 +1296,7 @@ static NTSTATUS dcesrv_samr_CreateUser2(struct dcesrv_call_state *dce_call, TALL
}
/* add core elements to the ldb_message for the user */
- msg->dn = ldb_dn_copy(mem_ctx, d_state->domain_dn);
+ msg->dn = ldb_dn_copy(msg, d_state->domain_dn);
if ( ! ldb_dn_add_child_fmt(msg->dn, "CN=%s,%s", cn_name, container)) {
ldb_transaction_cancel(d_state->sam_ctx);
return NT_STATUS_FOOBAR;
@@ -1344,7 +1344,7 @@ static NTSTATUS dcesrv_samr_CreateUser2(struct dcesrv_call_state *dce_call, TALL
a_state->account_dn = talloc_steal(a_state, msg->dn);
/* retrieve the sid and account control bits for the user just created */
- ret = gendb_search_dn(d_state->sam_ctx, a_state,
+ ret = gendb_search_dn(d_state->sam_ctx, mem_ctx,
msg->dn, &msgs, attrs);
if (ret != 1) {