s3:ntlmssp: replace server_role by a server.is_standalone in ntlmssp_state
authorStefan Metzmacher <metze@samba.org>
Wed, 30 Dec 2009 09:07:32 +0000 (10:07 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 24 Mar 2010 16:34:54 +0000 (17:34 +0100)
Inspired by the NTLMSSP merge work by Andrew Bartlett.

metze

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

index 88f0e694434833e1cefaa24a3a82c8e4300fb135..9eccebc564f7529ec790b29cc6d9893d2c202f6e 100644 (file)
@@ -184,7 +184,11 @@ NTSTATUS auth_ntlmssp_start(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
        (*auth_ntlmssp_state)->ntlmssp_state->may_set_challenge = auth_ntlmssp_may_set_challenge;
        (*auth_ntlmssp_state)->ntlmssp_state->set_challenge = auth_ntlmssp_set_challenge;
        (*auth_ntlmssp_state)->ntlmssp_state->check_password = auth_ntlmssp_check_password;
-       (*auth_ntlmssp_state)->ntlmssp_state->server_role = (enum server_types)lp_server_role();
+       if ((enum server_types)lp_server_role() == ROLE_STANDALONE) {
+               (*auth_ntlmssp_state)->ntlmssp_state->server.is_standalone = true;
+       } else {
+               (*auth_ntlmssp_state)->ntlmssp_state->server.is_standalone = false;
+       }
 
        return NT_STATUS_OK;
 }
index 31b614fb5415b9b87071a103b70b2746c54dd35e..636a0e7d5de191e1abea27078d3d8dd7ac39f3d1 100644 (file)
@@ -45,7 +45,6 @@ enum ntlmssp_message_type
 struct ntlmssp_state
 {
        enum ntlmssp_role role;
-       enum server_types server_role;
        uint32_t expected_state;
 
        bool unicode;
@@ -58,6 +57,10 @@ struct ntlmssp_state
        unsigned char *lm_hash;
        char *server_domain;
 
+       struct {
+               bool is_standalone;
+       } server;
+
        DATA_BLOB internal_chal; /* Random challenge as supplied to the client for NTLM authentication */
 
        DATA_BLOB chal; /* Random challenge as input into the actual NTLM (or NTLM2) authentication */
index 8a5b7ac5c4aa62c0fe20d1fba6fa9dd0433f8104..c5b445d44366c01ef4e2ce29d702ffdf5013a7c7 100644 (file)
@@ -367,7 +367,7 @@ static const char *ntlmssp_target_name(struct ntlmssp_state *ntlmssp_state,
        if (neg_flags & NTLMSSP_REQUEST_TARGET) {
                *chal_flags |= NTLMSSP_NEGOTIATE_TARGET_INFO;
                *chal_flags |= NTLMSSP_REQUEST_TARGET;
-               if (ntlmssp_state->server_role == ROLE_STANDALONE) {
+               if (ntlmssp_state->server.is_standalone) {
                        *chal_flags |= NTLMSSP_TARGET_TYPE_SERVER;
                        return ntlmssp_state->get_global_myname();
                } else {
@@ -902,7 +902,7 @@ NTSTATUS ntlmssp_server_start(struct ntlmssp_state **ntlmssp_state)
 
        (*ntlmssp_state)->get_global_myname = global_myname;
        (*ntlmssp_state)->get_domain = lp_workgroup;
-       (*ntlmssp_state)->server_role = ROLE_DOMAIN_MEMBER; /* a good default */
+       (*ntlmssp_state)->server.is_standalone = false; /* a good default */
 
        (*ntlmssp_state)->expected_state = NTLMSSP_NEGOTIATE;