s3:ntlmssp: remove server_name from ntlmssp_state and fill the server.* fields also...
authorStefan Metzmacher <metze@samba.org>
Wed, 30 Dec 2009 12:29:54 +0000 (13:29 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 24 Mar 2010 16:34:55 +0000 (17:34 +0100)
Inspired by the NTLMSSP merge work by Andrew Bartlett.

metze

Signed-off-by: Günther Deschner <gd@samba.org>
source3/include/ntlmssp.h
source3/libsmb/cliconnect.c
source3/libsmb/ntlmssp.c

index 9c9b1fc951876f5a7f19a510f12546b142c3a21f..f44922f7b518120dc61bf7dbd3fbb036f054b7e1 100644 (file)
@@ -55,7 +55,6 @@ struct ntlmssp_state
        char *workstation;
        unsigned char *nt_hash;
        unsigned char *lm_hash;
-       char *server_domain;
 
        struct {
                bool is_standalone;
index 256ca2e02771ed26b57484084f02e423f915a5a2..11faa27b3f5fcf9ed5d562a73d3e481c89d7a411 100644 (file)
@@ -1061,7 +1061,7 @@ static void cli_session_setup_ntlmssp_done(struct tevent_req *subreq)
        if (NT_STATUS_IS_OK(status)) {
                if (state->cli->server_domain[0] == '\0') {
                        fstrcpy(state->cli->server_domain,
-                               state->ntlmssp_state->server_domain);
+                               state->ntlmssp_state->server.netbios_domain);
                }
                cli_set_session_key(
                        state->cli, state->ntlmssp_state->session_key);
index ac856bc489eabb795234b7da70866bf990b52026..872358846784f881717fcd2117a2ffe2207dfce7 100644 (file)
@@ -1140,7 +1140,16 @@ noccache:
                return NT_STATUS_INVALID_PARAMETER;
        }
 
-       ntlmssp_state->server_domain = server_domain;
+       if (chal_flags & NTLMSSP_TARGET_TYPE_SERVER) {
+               ntlmssp_state->server.is_standalone = true;
+       } else {
+               ntlmssp_state->server.is_standalone = false;
+       }
+       /* TODO: parse struct_blob and fill in the rest */
+       ntlmssp_state->server.netbios_name = "";
+       ntlmssp_state->server.netbios_domain = server_domain;
+       ntlmssp_state->server.dns_name = "";
+       ntlmssp_state->server.dns_domain = "";
 
        if (challenge_blob.length != 8) {
                data_blob_free(&struct_blob);