diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-12-30 10:07:32 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-03-24 17:34:54 +0100 |
commit | eca118614c1431855c88b9f43457c0d2d6502ebe (patch) | |
tree | 8e11f50553b49f532bff4dbcb1d0f402f7d86a38 /source3 | |
parent | 533830543f4282dfb13173dcf8ccf5e65f9d1ed4 (diff) | |
download | samba-eca118614c1431855c88b9f43457c0d2d6502ebe.tar.gz samba-eca118614c1431855c88b9f43457c0d2d6502ebe.tar.bz2 samba-eca118614c1431855c88b9f43457c0d2d6502ebe.zip |
s3:ntlmssp: replace server_role by a server.is_standalone in ntlmssp_state
Inspired by the NTLMSSP merge work by Andrew Bartlett.
metze
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/auth/auth_ntlmssp.c | 6 | ||||
-rw-r--r-- | source3/include/ntlmssp.h | 5 | ||||
-rw-r--r-- | source3/libsmb/ntlmssp.c | 4 |
3 files changed, 11 insertions, 4 deletions
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c index 88f0e69443..9eccebc564 100644 --- a/source3/auth/auth_ntlmssp.c +++ b/source3/auth/auth_ntlmssp.c @@ -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; } diff --git a/source3/include/ntlmssp.h b/source3/include/ntlmssp.h index 31b614fb54..636a0e7d5d 100644 --- a/source3/include/ntlmssp.h +++ b/source3/include/ntlmssp.h @@ -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 */ diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c index 8a5b7ac5c4..c5b445d443 100644 --- a/source3/libsmb/ntlmssp.c +++ b/source3/libsmb/ntlmssp.c @@ -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; |