summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2005-04-19 15:13:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:35 -0500
commit2a7cdf80c92e3b2bbb5b2977ef3d3b130220a836 (patch)
tree1a0b0f4d47c8ff4fd05372ca6d06d457f8b0d1ac /source4
parentd7beee39bdc8a01bf204a01ea32b3ce410be9e45 (diff)
downloadsamba-2a7cdf80c92e3b2bbb5b2977ef3d3b130220a836.tar.gz
samba-2a7cdf80c92e3b2bbb5b2977ef3d3b130220a836.tar.bz2
samba-2a7cdf80c92e3b2bbb5b2977ef3d3b130220a836.zip
r6390: A couple of changes in useradd function regarding pointers.
rafal (This used to be commit d40a6703f5b1987c08cf47f83ca0079dfcb4b151)
Diffstat (limited to 'source4')
-rw-r--r--source4/libnet/userman.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/libnet/userman.c b/source4/libnet/userman.c
index 35230d48f6..72034da75e 100644
--- a/source4/libnet/userman.c
+++ b/source4/libnet/userman.c
@@ -38,7 +38,8 @@ struct useradd_state {
struct rpc_request *req;
struct policy_handle domain_handle;
struct samr_CreateUser createuser;
- struct policy_handle *user_handle;
+ struct policy_handle user_handle;
+ uint32_t user_rid;
};
@@ -90,7 +91,6 @@ static void useradd_handler(struct rpc_request *req)
* @param p dce/rpc call pipe
* @param io arguments and results of the call
*/
-
struct composite_context *rpc_composite_useradd_send(struct dcerpc_pipe *p,
struct rpc_composite_useradd *io)
{
@@ -103,7 +103,7 @@ struct composite_context *rpc_composite_useradd_send(struct dcerpc_pipe *p,
s = talloc_zero(c, struct useradd_state);
if (s == NULL) goto failure;
-
+
s->domain_handle = io->in.domain_handle;
s->pipe = p;
@@ -115,6 +115,8 @@ struct composite_context *rpc_composite_useradd_send(struct dcerpc_pipe *p,
s->createuser.in.domain_handle = &io->in.domain_handle;
s->createuser.in.account_name = talloc_zero(c, struct samr_String);
s->createuser.in.account_name->string = talloc_strdup(c, io->in.username);
+ s->createuser.out.user_handle = &s->user_handle;
+ s->createuser.out.rid = &s->user_rid;
/* send request */
s->req = dcerpc_samr_CreateUser_send(p, c, &s->createuser);
@@ -150,9 +152,9 @@ NTSTATUS rpc_composite_useradd_recv(struct composite_context *c, TALLOC_CTX *mem
status = composite_wait(c);
if (NT_STATUS_IS_OK(status) && io) {
+ /* get and return result of the call */
s = talloc_get_type(c->private, struct useradd_state);
- talloc_steal(mem_ctx, s->user_handle);
- io->out.user_handle = *s->user_handle;
+ io->out.user_handle = s->user_handle;
}
talloc_free(c);