summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc/dcerpc_smb.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc/rpc/dcerpc_smb.c')
-rw-r--r--source4/librpc/rpc/dcerpc_smb.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c
index e16142d5c2..594feb8d64 100644
--- a/source4/librpc/rpc/dcerpc_smb.c
+++ b/source4/librpc/rpc/dcerpc_smb.c
@@ -350,7 +350,7 @@ static NTSTATUS smb_shutdown_pipe(struct dcerpc_connection *c)
}
/*
- return SMB server name
+ return SMB server name (called name)
*/
static const char *smb_peer_name(struct dcerpc_connection *c)
{
@@ -359,6 +359,15 @@ static const char *smb_peer_name(struct dcerpc_connection *c)
}
/*
+ return remote name we make the actual connection (good for kerberos)
+*/
+static const char *smb_target_hostname(struct dcerpc_connection *c)
+{
+ struct smb_private *smb = talloc_get_type(c->transport.private, struct smb_private);
+ return smb->tree->session->transport->socket->hostname;
+}
+
+/*
fetch the user session key
*/
static NTSTATUS smb_session_key(struct dcerpc_connection *c, DATA_BLOB *session_key)
@@ -462,14 +471,15 @@ static void pipe_open_recv(struct smbcli_request *req)
/*
fill in the transport methods
*/
- c->transport.transport = NCACN_NP;
- c->transport.private = NULL;
- c->transport.shutdown_pipe = smb_shutdown_pipe;
- c->transport.peer_name = smb_peer_name;
-
- c->transport.send_request = smb_send_request;
- c->transport.send_read = send_read_request;
- c->transport.recv_data = NULL;
+ c->transport.transport = NCACN_NP;
+ c->transport.private = NULL;
+ c->transport.shutdown_pipe = smb_shutdown_pipe;
+ c->transport.peer_name = smb_peer_name;
+ c->transport.target_hostname = smb_target_hostname;
+
+ c->transport.send_request = smb_send_request;
+ c->transport.send_read = send_read_request;
+ c->transport.recv_data = NULL;
/* Over-ride the default session key with the SMB session key */
c->security_state.session_key = smb_session_key;