From 46111dc4e437f9cd4df1dbf2ecfe6a56eaf1ae39 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 6 Jan 2010 16:35:44 +0100 Subject: s3:auth:check_sam_security: introduce a bool var to control pad_pw_count incrementation This is a preparatory patch for the last part in fixing bug #4347 . Michael --- source3/auth/auth_sam.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source3/auth') diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c index e7b9f2b019..4c3f552ee6 100644 --- a/source3/auth/auth_sam.c +++ b/source3/auth/auth_sam.c @@ -354,10 +354,16 @@ static NTSTATUS check_sam_security(const struct auth_context *auth_context, update_login_attempts_status = pdb_update_login_attempts(sampass, NT_STATUS_IS_OK(nt_status)); if (!NT_STATUS_IS_OK(nt_status)) { + bool increment_bad_pw_count = false; + if (NT_STATUS_EQUAL(nt_status,NT_STATUS_WRONG_PASSWORD) && acct_ctrl & ACB_NORMAL && NT_STATUS_IS_OK(update_login_attempts_status)) - { + { + increment_bad_pw_count = true; + } + + if (increment_bad_pw_count) { pdb_increment_bad_password_count(sampass); updated_badpw = True; } else { -- cgit