diff options
-rw-r--r-- | source4/libnet/libnet_rpc.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/source4/libnet/libnet_rpc.c b/source4/libnet/libnet_rpc.c index 3574559d4f..fce7811138 100644 --- a/source4/libnet/libnet_rpc.c +++ b/source4/libnet/libnet_rpc.c @@ -147,8 +147,9 @@ static NTSTATUS libnet_RpcConnectSrv_recv(struct composite_context *c, mem_ctx is freed */ if (r->in.dcerpc_iface == &dcerpc_table_samr) { ctx->samr_pipe = talloc_reference(ctx, r->out.dcerpc_pipe); - } else { - ctx->pipe = talloc_reference(ctx, r->out.dcerpc_pipe); + + } else if (r->in.dcerpc_iface == &dcerpc_table_lsarpc) { + ctx->lsa_pipe = talloc_reference(ctx, r->out.dcerpc_pipe); } } else { r->out.error_string = talloc_steal(mem_ctx, s->r.out.error_string); @@ -321,9 +322,11 @@ static NTSTATUS libnet_RpcConnectDC_recv(struct composite_context *c, mem_ctx is freed */ if (r->in.dcerpc_iface == &dcerpc_table_samr) { ctx->samr_pipe = talloc_reference(ctx, r->out.dcerpc_pipe); - } else { - ctx->pipe = talloc_reference(ctx, r->out.dcerpc_pipe); + + } else if (r->in.dcerpc_iface == &dcerpc_table_lsarpc) { + ctx->lsa_pipe = talloc_reference(ctx, r->out.dcerpc_pipe); } + } else { r->out.error_string = talloc_steal(mem_ctx, s->r.out.error_string); } @@ -432,7 +435,7 @@ static void continue_dci_rpc_connect(struct composite_context *ctx) } /* prepare to open a policy handle on lsa pipe */ - s->lsa_pipe = s->ctx->pipe; + s->lsa_pipe = s->ctx->lsa_pipe; s->qos.len = 0; s->qos.impersonation_level = 2; @@ -684,9 +687,11 @@ static NTSTATUS libnet_RpcConnectDCInfo_recv(struct composite_context *c, struct mem_ctx is freed */ if (r->in.dcerpc_iface == &dcerpc_table_samr) { ctx->samr_pipe = talloc_reference(ctx, r->out.dcerpc_pipe); - } else { - ctx->pipe = talloc_reference(ctx, r->out.dcerpc_pipe); + + } else if (r->in.dcerpc_iface == &dcerpc_table_lsarpc) { + ctx->lsa_pipe = talloc_reference(ctx, r->out.dcerpc_pipe); } + } else { r->out.error_string = talloc_steal(mem_ctx, s->r.out.error_string); } |