i am calling LogonUser to try to validate a set of credentials:
LogonUser("forest", "avatopia.com" "stapler",
LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_WINNT50, out token);
And it returns true, even though the account is disabled:

i also tried using SSPI directly to validate credentials, which involves calling:
AcquireCredentialsHandle(..., "Negotiate", SECPKG_CRED_OUTBOUND, ..., ["forest", "stapler", "avatopia.com"], ...)InitializeSecurityContext(...)AcquireCredentialsHandle(..., "Negotiate", SECPKG_CRED_INBOUND, ...)AcceptSecurityContext(...)InitializeSecurityContext(...)AcceptSecurityContext(...)On most machines the initial call to
AcquireCredentialsHandlefails if the user account is disabled. But on this particular machine i'm testing it completes the entire cycle and works.
If i try with invalid password then LogonUser does (correctly) fail:
LogonUser("forest", "avatopia.com" "adf342sdf3",
LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_WINNT50, out token);
returns false, and GetLastError returns 1326 (Logon failure: unknown user name or password)
Trying SSPI with an invalid password also (correctly) fails:
AcquireCredentialsHandle(..., "Negotiate", SECPKG_CRED_OUTBOUND, ..., ["forest", "adf342sdf3", "avatopia.com"], ...)InitializeSecurityContext(...)AcquireCredentialsHandle(..., "Negotiate", SECPKG_CRED_INBOUND, ...)AcceptSecurityContext(...)fails with8009030C(The logon attempt failed)
What is aggrevating is that this behavior is only happening on one machine.
Why would LogonUser, and the entire Security Support Provider Interface, indicate that credentails of a disabled account on a particular domain-joined machine: are valid?
- domain joined machine where
LogonUser(incorrectly) succeeds: Windows XP SP2 - domain joined machine where
LogonUser(correctly) fails: Windows XP SP2
Update:
There is no local user called Forest:
nor is there any local user called Forest:
which is irrelevant because i'm asking for avatopia.com\Forest, and not speeder\Forest.
oi vay People get their panties in a bunch just because a disabled user was allowed to access something they should have not have been allowed to access.


hanandsolo) - Ian Boyd