s4-libnet: Add mem_ctx to libnet_rpc_groupinfo calls (bug #8889)
authorAndrew Bartlett <abartlet@samba.org>
Mon, 30 Apr 2012 10:09:58 +0000 (20:09 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 30 Apr 2012 11:08:28 +0000 (13:08 +0200)
source4/libnet/groupinfo.c
source4/libnet/libnet_group.c

index 0bc0d9f4b8cfca9c020790a3e5d3e68875b08976..9060973e02ef04361cdb92b35d361033be95364e 100644 (file)
@@ -262,6 +262,7 @@ static void continue_groupinfo_closegroup(struct tevent_req *subreq)
  * @param io arguments and results of the call
  */
 struct composite_context *libnet_rpc_groupinfo_send(struct dcerpc_pipe *p,
+                                                   TALLOC_CTX *mem_ctx,
                                                    struct libnet_rpc_groupinfo *io,
                                                    void (*monitor)(struct monitor_msg*))
 {
@@ -272,7 +273,7 @@ struct composite_context *libnet_rpc_groupinfo_send(struct dcerpc_pipe *p,
 
        if (!p || !io) return NULL;
        
-       c = composite_create(p, dcerpc_event_context(p));
+       c = composite_create(mem_ctx, dcerpc_event_context(p));
        if (c == NULL) return c;
        
        s = talloc_zero(c, struct groupinfo_state);
@@ -372,6 +373,6 @@ NTSTATUS libnet_rpc_groupinfo(struct dcerpc_pipe *p,
                              TALLOC_CTX *mem_ctx,
                              struct libnet_rpc_groupinfo *io)
 {
-       struct composite_context *c = libnet_rpc_groupinfo_send(p, io, NULL);
+       struct composite_context *c = libnet_rpc_groupinfo_send(p, mem_ctx, io, NULL);
        return libnet_rpc_groupinfo_recv(c, mem_ctx, io);
 }
index c98a47738367ac17d470bb97fb4651cba14a370a..5fc3f2b12a34cb89ac5e3c660895f853e8161562 100644 (file)
@@ -257,7 +257,7 @@ struct composite_context* libnet_GroupInfo_send(struct libnet_context *ctx,
                s->info.in.level         = GROUPINFOALL;
 
                /* send the request */
-               info_req = libnet_rpc_groupinfo_send(s->ctx->samr.pipe, &s->info, s->monitor_fn);
+               info_req = libnet_rpc_groupinfo_send(s->ctx->samr.pipe, s, &s->info, s->monitor_fn);
                if (composite_nomem(info_req, c)) return c;
 
                /* set the next stage */
@@ -306,7 +306,7 @@ static void continue_domain_open_info(struct composite_context *ctx)
                s->info.in.level         = GROUPINFOALL;
 
                /* send the request */
-               info_req = libnet_rpc_groupinfo_send(s->ctx->samr.pipe, &s->info, s->monitor_fn);
+               info_req = libnet_rpc_groupinfo_send(s->ctx->samr.pipe, s, &s->info, s->monitor_fn);
                if (composite_nomem(info_req, c)) return;
 
                /* set the next stage */
@@ -348,7 +348,7 @@ static void continue_name_found(struct composite_context *ctx)
        s->info.in.level         = GROUPINFOALL;
 
        /* send the request */
-       info_req = libnet_rpc_groupinfo_send(s->ctx->samr.pipe, &s->info, s->monitor_fn);
+       info_req = libnet_rpc_groupinfo_send(s->ctx->samr.pipe, s, &s->info, s->monitor_fn);
        if (composite_nomem(info_req, c)) return;
 
        /* set the next stage */