s4-s3upgrade: Do not ever set a domain-wide maxPwdAge of 0
authorAndrew Bartlett <abartlet@samba.org>
Thu, 19 Apr 2012 00:42:05 +0000 (10:42 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 19 Apr 2012 04:19:09 +0000 (14:19 +1000)
This means no-expiry in s3, and so we must treat it like -1.

Andrew Bartlett

source4/scripting/python/samba/upgrade.py

index ab9d9374d58e8c46179411e7bec7d5c1271ba356..62cba23af7c69e4b26419c69519ef034337f4f06 100644 (file)
@@ -65,7 +65,7 @@ def import_sam_policy(samdb, policy, logger):
         'minPwdAge')
 
     max_pw_age_unix = policy['maximum password age']
-    if max_pw_age_unix == -1:
+    if max_pw_age_unix == -1 || max_pw_age_unix == 0:
         max_pw_age_nt = -0x8000000000000000
     else:
         max_pw_age_nt = int(-max_pw_age_unix * (1e7 * 60 * 60 * 24))