mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
Correctly handle per-pipe NTLMSSP inside a NULL session. Previously we
would attempt to supply a password to the 'inside' NTLMSSP, which the
remote side naturally rejected.
Andrew Bartlett
(This used to be commit da408e0d5a
)
This commit is contained in:
parent
a7f8c26d24
commit
425699fce7
@ -45,8 +45,14 @@ static void pwd_make_lm_nt_16(struct pwd_info *pwd, const char *clr)
|
||||
{
|
||||
pwd_init(pwd);
|
||||
|
||||
nt_lm_owf_gen(clr, pwd->smb_nt_pwd, pwd->smb_lm_pwd);
|
||||
pwd->null_pwd = False;
|
||||
if (!clr) {
|
||||
ZERO_STRUCT(pwd->smb_nt_pwd);
|
||||
ZERO_STRUCT(pwd->smb_lm_pwd);
|
||||
pwd->null_pwd = True;
|
||||
} else {
|
||||
nt_lm_owf_gen(clr, pwd->smb_nt_pwd, pwd->smb_lm_pwd);
|
||||
pwd->null_pwd = False;
|
||||
}
|
||||
pwd->crypted = False;
|
||||
}
|
||||
|
||||
|
@ -1342,11 +1342,18 @@ static BOOL rpc_pipe_bind(struct cli_state *cli, int pipe_idx, const char *my_na
|
||||
if (!NT_STATUS_IS_OK(nt_status))
|
||||
return False;
|
||||
|
||||
pwd_get_cleartext(&cli->pwd, password);
|
||||
nt_status = ntlmssp_set_password(cli->ntlmssp_pipe_state,
|
||||
password);
|
||||
if (!NT_STATUS_IS_OK(nt_status))
|
||||
return False;
|
||||
if (cli->pwd.null_pwd) {
|
||||
nt_status = ntlmssp_set_password(cli->ntlmssp_pipe_state,
|
||||
NULL);
|
||||
if (!NT_STATUS_IS_OK(nt_status))
|
||||
return False;
|
||||
} else {
|
||||
pwd_get_cleartext(&cli->pwd, password);
|
||||
nt_status = ntlmssp_set_password(cli->ntlmssp_pipe_state,
|
||||
password);
|
||||
if (!NT_STATUS_IS_OK(nt_status))
|
||||
return False;
|
||||
}
|
||||
|
||||
if (cli->pipe_auth_flags & AUTH_PIPE_SIGN) {
|
||||
cli->ntlmssp_pipe_state->neg_flags |= NTLMSSP_NEGOTIATE_SIGN;
|
||||
|
Loading…
Reference in New Issue
Block a user