s4:libnet: keep a dcerpc_binding_handle for samr and lsa
authorStefan Metzmacher <metze@samba.org>
Thu, 16 Jan 2014 12:31:43 +0000 (13:31 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 16 Jan 2014 15:22:51 +0000 (16:22 +0100)
This completes commit a3ae9802d47f7a39030be089d15fc42f8e8917e6.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/libnet/libnet_rpc.c

index 13115288b1d37abdf5c814d590964aff77e3fc46..b298adcfa638adf8efd74e84c47b137088bf1b91 100644 (file)
@@ -203,9 +203,11 @@ static NTSTATUS libnet_RpcConnectSrv_recv(struct composite_context *c,
                   mem_ctx is freed */
                if (r->in.dcerpc_iface == &ndr_table_samr) {
                        ctx->samr.pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
+                       ctx->samr.samr_handle = ctx->samr.pipe->binding_handle;
 
                } else if (r->in.dcerpc_iface == &ndr_table_lsarpc) {
                        ctx->lsa.pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
+                       ctx->lsa.lsa_handle = ctx->lsa.pipe->binding_handle;
                }
 
                r->out.error_string = talloc_strdup(mem_ctx, "Success");
@@ -424,9 +426,10 @@ static NTSTATUS libnet_RpcConnectDC_recv(struct composite_context *c,
                   mem_ctx is freed */
                if (r->in.dcerpc_iface == &ndr_table_samr) {
                        ctx->samr.pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
-
+                       ctx->samr.samr_handle = ctx->samr.pipe->binding_handle;
                } else if (r->in.dcerpc_iface == &ndr_table_lsarpc) {
                        ctx->lsa.pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
+                       ctx->lsa.lsa_handle = ctx->lsa.pipe->binding_handle;
                }
 
        } else {