From: Stefan Metzmacher Date: Thu, 20 Jul 2017 21:05:53 +0000 (+0200) Subject: s4:librpc/rpc: remember the target_hostname on ncacn_http connections X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=8d36bbe1874f47230d663e16de3c8e0e0800d997;p=metze%2Fsamba%2Fwip.git s4:librpc/rpc: remember the target_hostname on ncacn_http connections Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c index 8ed12578e212..bec7022f4d2e 100644 --- a/source4/librpc/rpc/dcerpc_connect.c +++ b/source4/librpc/rpc/dcerpc_connect.c @@ -422,6 +422,7 @@ static NTSTATUS dcerpc_pipe_connect_ncacn_ip_tcp_recv(struct composite_context * struct pipe_http_state { struct dcerpc_pipe_connect io; const char *localaddr; + const char *target_hostname; const char *rpc_server; uint32_t rpc_server_port; char *rpc_proxy; @@ -457,6 +458,8 @@ static void continue_pipe_open_ncacn_http(struct tevent_req *subreq) s->io.conn->transport.stream = stream; s->io.conn->transport.write_queue = queue; s->io.conn->transport.pending_reads = 0; + s->io.conn->server_name = strupper_talloc(s->io.conn, + s->target_hostname); composite_done(c); } @@ -493,6 +496,8 @@ static struct composite_context* dcerpc_pipe_connect_ncacn_http_send( "localaddress"); /* RPC server and port (the endpoint) */ s->rpc_server = dcerpc_binding_get_string_option(io->binding, "host"); + s->target_hostname = dcerpc_binding_get_string_option(io->binding, + "target_hostname"); endpoint = dcerpc_binding_get_string_option(io->binding, "endpoint"); if (endpoint == NULL) { composite_error(c, NT_STATUS_INVALID_PARAMETER_MIX);