secur32: Work around ntlm_auth in Samba 3.0.28a being broken for cached credentials.

Samba 3.0.28a (as shipped with Ubuntu 8.04) seems to break when using
cached credentials backed by winbindd, returning a BH error in our test
if we still need to provide a password. Handle this and report a more
correct error.
This commit is contained in:
Kai Blin 2009-04-13 22:39:39 +02:00 committed by Alexandre Julliard
parent 69ec6b4c6d
commit 7788c8ed0d
1 changed files with 13 additions and 1 deletions

View File

@ -662,9 +662,21 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(
ret = SEC_E_NO_CREDENTIALS;
goto isc_end;
}
else /* Just do a noop on the next run */
else
{
/* Some versions of Samba have a broken ntlm_auth that can
* return "BH" here. Catch this and abort. */
if(!strncmp(buffer, "BH", 2))
{
ERR("ntlm_auth replied 'BH'. This should not happen. "
"Please fix your ntlm_auth install and try again.\n");
ret = SEC_E_INTERNAL_ERROR;
goto isc_end;
}
/* Otherwise, just do a noop on the next run */
lstrcpynA(buffer, "OK", max_len-1);
}
}
else
{
lstrcpynA(buffer, "PW ", max_len-1);