r25401: BUG 4982: Don't delete lanman hashes on invalid logins when
authorGerald Carter <jerry@samba.org>
Fri, 28 Sep 2007 03:56:12 +0000 (03:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:31:02 +0000 (12:31 -0500)
using the "lanman auth = no".  Tested by Guenter Kukkukk.
(This used to be commit 611fdd95a583ebd22ffa17e2f39c5a1bb0936c63)

source3/auth/auth_sam.c
source3/passdb/pdb_interface.c

index eb02ad4e7dddc020b762d49f621a102e96333b09..9070de1ce4b06d411e693fd35435149854ce2fe0 100644 (file)
@@ -294,14 +294,16 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context,
        nt_status = sam_password_ok(auth_context, mem_ctx, sampass, 
                                    user_info, &user_sess_key, &lm_sess_key);
 
-       /* Notify passdb backend of login success/failure. If not NT_STATUS_OK the backend doesn't like the login */
+       /* Notify passdb backend of login success/failure. If not 
+          NT_STATUS_OK the backend doesn't like the login */
+
        update_login_attempts_status = pdb_update_login_attempts(sampass, NT_STATUS_IS_OK(nt_status));
-       if (!NT_STATUS_IS_OK(update_login_attempts_status))
-               nt_status = update_login_attempts_status;
 
        if (!NT_STATUS_IS_OK(nt_status)) {
                if (NT_STATUS_EQUAL(nt_status,NT_STATUS_WRONG_PASSWORD) && 
-                   pdb_get_acct_ctrl(sampass) &ACB_NORMAL) {  
+                   pdb_get_acct_ctrl(sampass) &ACB_NORMAL &&
+                   NT_STATUS_IS_OK(update_login_attempts_status)) 
+               {  
                        pdb_increment_bad_password_count(sampass);
                        updated_badpw = True;
                } else {
index 16cd03957261799a10b0f0307eab20d3a116aeb9..f038522eed70b36479c19904c49cb1cb2fb609e3 100644 (file)
@@ -1168,7 +1168,7 @@ static NTSTATUS pdb_default_rename_sam_account (struct pdb_methods *methods, str
 
 static NTSTATUS pdb_default_update_login_attempts (struct pdb_methods *methods, struct samu *newpwd, BOOL success)
 {
-       return NT_STATUS_OK;
+       return NT_STATUS_NOT_IMPLEMENTED;
 }
 
 static NTSTATUS pdb_default_setsampwent(struct pdb_methods *methods, BOOL update, uint32 acb_mask)