handle both 0 and -1 as disabling reset count and lockout duration
authorJim McDonough <jmcd@samba.org>
Fri, 20 Feb 2004 16:00:25 +0000 (16:00 +0000)
committerJim McDonough <jmcd@samba.org>
Fri, 20 Feb 2004 16:00:25 +0000 (16:00 +0000)
(This used to be commit 84fe24e64ee405bb25878c1e5fdf50592eb75f73)

source3/passdb/passdb.c

index 1f1b5bdae60b98456e73a663608cbfec55ff437f..7c9376e045a03f327adb0b23c5ddf882c495a85a 100644 (file)
@@ -2223,8 +2223,8 @@ BOOL pdb_update_bad_password_count(SAM_ACCOUNT *sampass, BOOL *updated)
        }
 
        /* First, check if there is a reset time to compare */
-       if (!resettime) {
-               DEBUG(9, ("Reset time = 0, can't reset bad pw count\n"));
+       if ((resettime == (uint32) -1) || (resettime == 0)) {
+               DEBUG(9, ("No reset time, can't reset bad pw count\n"));
                return True;
        }
 
@@ -2262,8 +2262,8 @@ BOOL pdb_update_autolock_flag(SAM_ACCOUNT *sampass, BOOL *updated)
        }
 
        /* First, check if there is a duration to compare */
-       if (!duration) {
-               DEBUG(9, ("Lockout duration = 0, can't reset autolock\n"));
+       if ((duration == (uint32) -1)  || (duration == 0)) {
+               DEBUG(9, ("No reset duration, can't reset autolock\n"));
                return True;
        }