r11532: Enable kerberos session setup for winbind smb connections
authorVolker Lendecke <vlendec@samba.org>
Sun, 6 Nov 2005 12:19:34 +0000 (12:19 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:45:50 +0000 (13:45 -0500)
source/libcli/smb_composite/connect.c

index 643871a8c4efdd4ef937a257b6afb7bc3c2a3ee1..81a82ad4276b714e1c376486a5053356ced29981 100644 (file)
@@ -302,6 +302,15 @@ static NTSTATUS connect_socket(struct composite_context *c,
        state->transport = smbcli_transport_init(state->sock, state, True);
        NT_STATUS_HAVE_NO_MEMORY(state->transport);
 
+       if (state->io->in.called_name != NULL) {
+               /* If connecting to an IP address, we might want the real name
+                * of the host for later kerberos. The called name is a better
+                * approximation */
+               state->sock->hostname =
+                       talloc_strdup(state->sock, io->in.called_name);
+               NT_STATUS_HAVE_NO_MEMORY(state->sock->hostname);
+       }
+
        make_nbt_name_client(&calling, cli_credentials_get_workstation(io->in.credentials));
 
        nbt_choose_called_name(state, &called, io->in.called_name, NBT_NAME_SERVER);