summaryrefslogtreecommitdiff
path: root/source4/libnet/libnet_rpc.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-02-04 09:59:54 +0100
committerGünther Deschner <gd@samba.org>2014-02-13 11:54:16 +0100
commit776f5c65bf6123d4f6909724436c48fe900866f0 (patch)
tree048bdde6960364489b56f544c84d5638136db117 /source4/libnet/libnet_rpc.c
parentab5f89bc72e4d42fd12572e267f8c236705646fb (diff)
downloadsamba-776f5c65bf6123d4f6909724436c48fe900866f0.tar.gz
s4:libnet: use helper functions to access dcerpc_binding->target_hostname
If possible also specify the already known address as dcerpc_binding->host. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source4/libnet/libnet_rpc.c')
-rw-r--r--source4/libnet/libnet_rpc.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/source4/libnet/libnet_rpc.c b/source4/libnet/libnet_rpc.c
index db48ea3f7db..19838d4fe31 100644
--- a/source4/libnet/libnet_rpc.c
+++ b/source4/libnet/libnet_rpc.c
@@ -79,7 +79,8 @@ static struct composite_context* libnet_RpcConnectSrv_send(struct libnet_context
s->binding = talloc_asprintf(s, "ncacn_np:%s", r->in.name);
break;
case LIBNET_RPC_CONNECT_SERVER_ADDRESS:
- s->binding = talloc_asprintf(s, "ncacn_np:%s", r->in.address);
+ s->binding = talloc_asprintf(s, "ncacn_np:%s[target_hostname=%s]",
+ r->in.address, r->in.name);
break;
case LIBNET_RPC_CONNECT_BINDING:
@@ -121,13 +122,6 @@ static struct composite_context* libnet_RpcConnectSrv_send(struct libnet_context
if (!composite_is_ok(c)) return c;
}
- if (r->level == LIBNET_RPC_CONNECT_SERVER_ADDRESS) {
- b->target_hostname = talloc_strdup(b, r->in.name);
- if (composite_nomem(b->target_hostname, c)) {
- return c;
- }
- }
-
/* connect to remote dcerpc pipe */
pipe_connect_req = dcerpc_pipe_connect_b_send(c, b, r->in.dcerpc_iface,
ctx->cred, c->event_ctx,