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

metze

Signed-off-by: Günther Deschner <gd@samba.org>
source4/auth/ntlmssp/ntlmssp.h
source4/auth/ntlmssp/ntlmssp_server.c

index 82e9ccfd06a41b41159161fa51fbbfd48aaa3513..44a1064e15726aea3062bd613d87b3e6d5baba7f 100644 (file)
@@ -19,7 +19,6 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#include "librpc/gen_ndr/samr.h"
 #include "../librpc/gen_ndr/ntlmssp.h"
 
 /* NTLMSSP mode */
@@ -48,7 +47,6 @@ enum ntlmssp_message_type
 struct gensec_ntlmssp_state
 {
        enum ntlmssp_role role;
-       enum samr_Role server_role;
        uint32_t expected_state;
 
        bool unicode;
@@ -66,6 +64,10 @@ struct gensec_ntlmssp_state
        const char *workstation;
        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 428178158ddf1442382def231b3be87d24fde950..484cf3f51d1912d14e77b6bbfd0463a1693cf0df 100644 (file)
@@ -92,7 +92,7 @@ static const char *ntlmssp_target_name(struct gensec_ntlmssp_state *gensec_ntlms
        if (neg_flags & NTLMSSP_REQUEST_TARGET) {
                *chal_flags |= NTLMSSP_NEGOTIATE_TARGET_INFO;
                *chal_flags |= NTLMSSP_REQUEST_TARGET;
-               if (gensec_ntlmssp_state->server_role == ROLE_STANDALONE) {
+               if (gensec_ntlmssp_state->server.is_standalone) {
                        *chal_flags |= NTLMSSP_TARGET_TYPE_SERVER;
                        return gensec_ntlmssp_state->server_name;
                } else {
@@ -819,7 +819,11 @@ NTSTATUS gensec_ntlmssp_server_start(struct gensec_security *gensec_security)
        gensec_ntlmssp_state->may_set_challenge = auth_ntlmssp_may_set_challenge;
        gensec_ntlmssp_state->set_challenge = auth_ntlmssp_set_challenge;
        gensec_ntlmssp_state->check_password = auth_ntlmssp_check_password;
-       gensec_ntlmssp_state->server_role = lp_server_role(gensec_security->settings->lp_ctx);
+       if (lp_server_role(gensec_security->settings->lp_ctx) == ROLE_STANDALONE) {
+               gensec_ntlmssp_state->server.is_standalone = true;
+       } else {
+               gensec_ntlmssp_state->server.is_standalone = false;
+       }
 
        return NT_STATUS_OK;
 }