summaryrefslogtreecommitdiff
path: root/source4/libnet/libnet_rpc.c
diff options
context:
space:
mode:
authorRafal Szczesniak <mimir@samba.org>2006-08-21 20:52:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:21 -0500
commit1f8fda717f95edb63d4596321b8c8bfafd5a4497 (patch)
tree8c5c0db423ad19d18661953bab46fb5d06927996 /source4/libnet/libnet_rpc.c
parent7cb4dcf146b7ca41b8504571151911f0b3161e28 (diff)
downloadsamba-1f8fda717f95edb63d4596321b8c8bfafd5a4497.tar.gz
samba-1f8fda717f95edb63d4596321b8c8bfafd5a4497.tar.bz2
samba-1f8fda717f95edb63d4596321b8c8bfafd5a4497.zip
r17670: 1) Refactor libnet context structure a bit, to have rpc connection
properties more consistently reflected. 2) Add domain open routine for lsa pipe - this is needed for ongoing name resolve function. Tests (still neglected) and comments to follow. rafal (This used to be commit fe5652c2b8121bbe3b9932c43164035355478611)
Diffstat (limited to 'source4/libnet/libnet_rpc.c')
-rw-r--r--source4/libnet/libnet_rpc.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source4/libnet/libnet_rpc.c b/source4/libnet/libnet_rpc.c
index eedef7989d..53c8ba86a1 100644
--- a/source4/libnet/libnet_rpc.c
+++ b/source4/libnet/libnet_rpc.c
@@ -148,10 +148,10 @@ static NTSTATUS libnet_RpcConnectSrv_recv(struct composite_context *c,
so that it can be used by other api functions even after short-term
mem_ctx is freed */
if (r->in.dcerpc_iface == &dcerpc_table_samr) {
- ctx->samr_pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
+ ctx->samr.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);
+ ctx->lsa.pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
}
} else {
r->out.error_string = talloc_steal(mem_ctx, s->r.out.error_string);
@@ -361,14 +361,16 @@ static NTSTATUS libnet_RpcConnectDC_recv(struct composite_context *c,
so that it can be used by other api functions even after short-term
mem_ctx is freed */
if (r->in.dcerpc_iface == &dcerpc_table_samr) {
- ctx->samr_pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
+ ctx->samr.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);
+ ctx->lsa.pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
}
} else {
- r->out.error_string = talloc_steal(mem_ctx, s->r.out.error_string);
+ r->out.error_string = talloc_asprintf(mem_ctx,
+ "Failed to rpc connect: %s",
+ nt_errstr(status));
}
talloc_free(c);
@@ -475,7 +477,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->lsa_pipe;
+ s->lsa_pipe = s->ctx->lsa.pipe;
s->qos.len = 0;
s->qos.impersonation_level = 2;
@@ -726,10 +728,10 @@ static NTSTATUS libnet_RpcConnectDCInfo_recv(struct composite_context *c, struct
so that it can be used by other api functions even after short-term
mem_ctx is freed */
if (r->in.dcerpc_iface == &dcerpc_table_samr) {
- ctx->samr_pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
+ ctx->samr.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);
+ ctx->lsa.pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
}
} else {