mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
r86: This function was moved to lib/nterr.h
Andrew Bartlett (This used to be commit 1c6d0399d67c9206baf7d4173cc00540146fa897)
This commit is contained in:
parent
e0da679d7c
commit
50ac33f582
@ -1400,34 +1400,6 @@ NT_USER_TOKEN *dup_nt_token(NT_USER_TOKEN *ptoken)
|
||||
return token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Squash an NT_STATUS in line with security requirements.
|
||||
* In an attempt to avoid giving the whole game away when users
|
||||
* are authenticating, NT replaces both NT_STATUS_NO_SUCH_USER and
|
||||
* NT_STATUS_WRONG_PASSWORD with NT_STATUS_LOGON_FAILURE in certain situations
|
||||
* (session setups in particular).
|
||||
*
|
||||
* @param nt_status NTSTATUS input for squashing.
|
||||
* @return the 'squashed' nt_status
|
||||
**/
|
||||
|
||||
NTSTATUS nt_status_squash(NTSTATUS nt_status)
|
||||
{
|
||||
if NT_STATUS_IS_OK(nt_status) {
|
||||
return nt_status;
|
||||
} else if NT_STATUS_EQUAL(nt_status, NT_STATUS_NO_SUCH_USER) {
|
||||
/* Match WinXP and don't give the game away */
|
||||
return NT_STATUS_LOGON_FAILURE;
|
||||
|
||||
} else if NT_STATUS_EQUAL(nt_status, NT_STATUS_WRONG_PASSWORD) {
|
||||
/* Match WinXP and don't give the game away */
|
||||
return NT_STATUS_LOGON_FAILURE;
|
||||
} else {
|
||||
return nt_status;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verify whether or not given domain is trusted.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user