mirror of
https://github.com/samba-team/samba.git
synced 2025-03-20 22:50:26 +03:00
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>
This commit is contained in:
parent
533830543f
commit
eca118614c
@ -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;
|
||||
}
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user