summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-06-16 18:05:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:51:58 -0500
commitbd178fd7a24445b6c5b77961c63926e86b2f1715 (patch)
treed05f92bb7c68ae0a1fd800f52d9bb8850ab49d0d
parent4dddfb74aefbe62367769af5fea36859bdce38f2 (diff)
downloadsamba-bd178fd7a24445b6c5b77961c63926e86b2f1715.tar.gz
samba-bd178fd7a24445b6c5b77961c63926e86b2f1715.tar.bz2
samba-bd178fd7a24445b6c5b77961c63926e86b2f1715.zip
r1171: Patch from "Lu, Jianliang" <Jianliang.Lu@getronics.com> to
reset password counts when account is reset. Jeremy. (This used to be commit 6fb64d8b368d1b24768c5817d5deac1e502e694a)
-rw-r--r--source3/rpc_server/srv_samr_util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_samr_util.c b/source3/rpc_server/srv_samr_util.c
index 417a712036..8cc44074ab 100644
--- a/source3/rpc_server/srv_samr_util.c
+++ b/source3/rpc_server/srv_samr_util.c
@@ -240,6 +240,12 @@ void copy_id21_to_sam_passwd(SAM_ACCOUNT *to, SAM_USER_INFO_21 *from)
if (from->fields_present & ACCT_FLAGS) {
DEBUG(10,("INFO_21 ACCT_CTRL: %08X -> %08X\n",pdb_get_acct_ctrl(to),from->acb_info));
if (from->acb_info != pdb_get_acct_ctrl(to)) {
+ if (!(from->acb_info & ACB_AUTOLOCK) && (pdb_get_acct_ctrl(to) & ACB_AUTOLOCK)) {
+ /* We're unlocking a previously locked user. Reset bad password counts.
+ Patch from Jianliang Lu. <Jianliang.Lu@getronics.com> */
+ pdb_set_bad_password_count(to, 0, PDB_CHANGED);
+ pdb_set_bad_password_time(to, 0, PDB_CHANGED);
+ }
pdb_set_acct_ctrl(to, from->acb_info, PDB_CHANGED);
}
}