summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-02-02 22:02:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:41 -0500
commit685ca94ac24842fddf22e31edc39de40b0729248 (patch)
treede63d7f1b30acd2b4a89dfe32863dfe3521ba30d /source3/auth
parent7074680bcf4484b91428fa39c733e95c3563524e (diff)
downloadsamba-685ca94ac24842fddf22e31edc39de40b0729248.tar.gz
samba-685ca94ac24842fddf22e31edc39de40b0729248.tar.bz2
samba-685ca94ac24842fddf22e31edc39de40b0729248.zip
r21128: Fix Vista connecting to Samba in share level security.
Vista sends the NTLMv2 blob by default in the tconX packet. Make sure we save off the workgroup the user was logged into on the client in the sessionsetupX and re-use it for the NTLMv2 calc. Jeremy. (This used to be commit 45dcf62960c2815c4d8e0c5f4a2d0af24df83290)
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/auth_compat.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/auth/auth_compat.c b/source3/auth/auth_compat.c
index bd5d7f0229..7b9802f7d4 100644
--- a/source3/auth/auth_compat.c
+++ b/source3/auth/auth_compat.c
@@ -92,18 +92,25 @@ static NTSTATUS pass_check_smb(const char *smb_name,
check if a username/password pair is ok via the auth subsystem.
return True if the password is correct, False otherwise
****************************************************************************/
+
BOOL password_ok(char *smb_name, DATA_BLOB password_blob)
{
DATA_BLOB null_password = data_blob(NULL, 0);
- BOOL encrypted = (global_encrypted_passwords_negotiated && password_blob.length == 24);
+ BOOL encrypted = (global_encrypted_passwords_negotiated && (password_blob.length == 24 || password_blob.length > 46));
if (encrypted) {
/*
* The password could be either NTLM or plain LM. Try NTLM first,
* but fall-through as required.
- * NTLMv2 makes no sense here.
+ * Vista sends NTLMv2 here - we need to try the client given workgroup.
*/
+ if (get_session_workgroup()) {
+ if (NT_STATUS_IS_OK(pass_check_smb(smb_name, get_session_workgroup(), null_password, password_blob, null_password, encrypted))) {
+ return True;
+ }
+ }
+
if (NT_STATUS_IS_OK(pass_check_smb(smb_name, lp_workgroup(), null_password, password_blob, null_password, encrypted))) {
return True;
}
@@ -119,5 +126,3 @@ BOOL password_ok(char *smb_name, DATA_BLOB password_blob)
return False;
}
-
-