summaryrefslogtreecommitdiff
path: root/source4/libnet
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libnet')
-rw-r--r--source4/libnet/libnet_user.c8
-rw-r--r--source4/libnet/userman.c18
2 files changed, 16 insertions, 10 deletions
diff --git a/source4/libnet/libnet_user.c b/source4/libnet/libnet_user.c
index 38378a21d48..3eea71d196b 100644
--- a/source4/libnet/libnet_user.c
+++ b/source4/libnet/libnet_user.c
@@ -88,7 +88,9 @@ struct composite_context* libnet_CreateUser_send(struct libnet_context *ctx,
s->user_add.in.domain_handle = ctx->samr.handle;
/* send the request */
- create_req = libnet_rpc_useradd_send(ctx->samr.pipe, s, &s->user_add, monitor);
+ create_req = libnet_rpc_useradd_send(s, s->ctx->event_ctx,
+ ctx->samr.samr_handle,
+ &s->user_add, monitor);
if (composite_nomem(create_req, c)) return c;
/* set the next stage */
@@ -123,7 +125,9 @@ static void continue_domain_open_create(struct composite_context *ctx)
s->user_add.in.domain_handle = s->ctx->samr.handle;
/* send the request */
- create_req = libnet_rpc_useradd_send(s->ctx->samr.pipe, s, &s->user_add, s->monitor_fn);
+ create_req = libnet_rpc_useradd_send(s, s->ctx->event_ctx,
+ s->ctx->samr.samr_handle,
+ &s->user_add, s->monitor_fn);
if (composite_nomem(create_req, c)) return;
/* set the next stage */
diff --git a/source4/libnet/userman.c b/source4/libnet/userman.c
index a7301eab6c6..abb41429e99 100644
--- a/source4/libnet/userman.c
+++ b/source4/libnet/userman.c
@@ -31,7 +31,7 @@
*/
struct useradd_state {
- struct dcerpc_pipe *pipe;
+ struct dcerpc_binding_handle *binding_handle;
struct policy_handle domain_handle;
struct samr_CreateUser createuser;
struct policy_handle user_handle;
@@ -94,8 +94,9 @@ static void continue_useradd_create(struct tevent_req *subreq)
* @param monitor monitor function for providing information about the progress
*/
-struct composite_context *libnet_rpc_useradd_send(struct dcerpc_pipe *p,
- TALLOC_CTX *mem_ctx,
+struct composite_context *libnet_rpc_useradd_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct dcerpc_binding_handle *b,
struct libnet_rpc_useradd *io,
void (*monitor)(struct monitor_msg*))
{
@@ -103,10 +104,10 @@ struct composite_context *libnet_rpc_useradd_send(struct dcerpc_pipe *p,
struct useradd_state *s;
struct tevent_req *subreq;
- if (!p || !io) return NULL;
+ if (!b || !io) return NULL;
/* composite allocation and setup */
- c = composite_create(mem_ctx, dcerpc_event_context(p));
+ c = composite_create(mem_ctx, ev);
if (c == NULL) return NULL;
s = talloc_zero(c, struct useradd_state);
@@ -116,7 +117,7 @@ struct composite_context *libnet_rpc_useradd_send(struct dcerpc_pipe *p,
/* put passed arguments to the state structure */
s->domain_handle = io->in.domain_handle;
- s->pipe = p;
+ s->binding_handle= b;
s->monitor_fn = monitor;
/* preparing parameters to send rpc request */
@@ -133,7 +134,7 @@ struct composite_context *libnet_rpc_useradd_send(struct dcerpc_pipe *p,
/* send the request */
subreq = dcerpc_samr_CreateUser_r_send(s, c->event_ctx,
- p->binding_handle,
+ s->binding_handle,
&s->createuser);
if (composite_nomem(subreq, c)) return c;
@@ -183,7 +184,8 @@ NTSTATUS libnet_rpc_useradd(struct dcerpc_pipe *p,
TALLOC_CTX *mem_ctx,
struct libnet_rpc_useradd *io)
{
- struct composite_context *c = libnet_rpc_useradd_send(p, mem_ctx, io, NULL);
+ struct composite_context *c = libnet_rpc_useradd_send(mem_ctx, p->conn->event_ctx,
+ p->binding_handle, io, NULL);
return libnet_rpc_useradd_recv(c, mem_ctx, io);
}