From 57589e3b67c4fbe6412478bef9a46cdf5b1df795 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 25 Mar 2006 11:39:09 +0000 Subject: r14714: On DCE/RPC, we need the name of the remote server used on the socket, for Kerberos. It must be the full name contacted, not the 'called name' we might want to use for \\server things, so add another function. Andrew Bartlett (This used to be commit 6d57d1dbb76e7d1ca2fd4f1a6c0bacfa7a189e2b) --- source4/librpc/rpc/dcerpc_sock.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'source4/librpc/rpc/dcerpc_sock.c') diff --git a/source4/librpc/rpc/dcerpc_sock.c b/source4/librpc/rpc/dcerpc_sock.c index 0385a70d3c..05c66cd796 100644 --- a/source4/librpc/rpc/dcerpc_sock.c +++ b/source4/librpc/rpc/dcerpc_sock.c @@ -187,7 +187,16 @@ static NTSTATUS sock_shutdown_pipe(struct dcerpc_connection *p) */ static const char *sock_peer_name(struct dcerpc_connection *p) { - struct sock_private *sock = p->transport.private; + struct sock_private *sock = talloc_get_type(p->transport.private, struct sock_private); + return sock->server_name; +} + +/* + return remote name we make the actual connection (good for kerberos) +*/ +static const char *sock_target_hostname(struct dcerpc_connection *p) +{ + struct sock_private *sock = talloc_get_type(p->transport.private, struct sock_private); return sock->server_name; } @@ -226,15 +235,16 @@ static void continue_socket_connect(struct composite_context *ctx) /* fill in the transport methods */ - conn->transport.transport = s->transport; - conn->transport.private = NULL; + conn->transport.transport = s->transport; + conn->transport.private = NULL; - conn->transport.send_request = sock_send_request; - conn->transport.send_read = sock_send_read; - conn->transport.recv_data = NULL; + conn->transport.send_request = sock_send_request; + conn->transport.send_read = sock_send_read; + conn->transport.recv_data = NULL; - conn->transport.shutdown_pipe = sock_shutdown_pipe; - conn->transport.peer_name = sock_peer_name; + conn->transport.shutdown_pipe = sock_shutdown_pipe; + conn->transport.peer_name = sock_peer_name; + conn->transport.target_hostname = sock_target_hostname; sock->sock = s->socket_ctx; sock->pending_reads = 0; -- cgit