From 41ce496691c7d2a12cdd9db7ba293f0f7783d88d Mon Sep 17 00:00:00 2001 From: Andrew Kroeger Date: Sun, 6 Sep 2009 22:28:56 -0500 Subject: s4:pwsettings: Correct off by factor of 10 for ticks. The tick conversion math was off by a factor of 10 due to the incorrect usage of the "e" notation. The expression "XeY" means "X * (10^Y)", so the correct expression is 1e7 to get the correct adjustment for ticks. --- source4/setup/pwsettings | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/setup') diff --git a/source4/setup/pwsettings b/source4/setup/pwsettings index 49bb5519b3..f26bcf75f4 100755 --- a/source4/setup/pwsettings +++ b/source4/setup/pwsettings @@ -74,8 +74,8 @@ try: pwd_hist_len = int(res[0]["pwdHistoryLength"][0]) min_pwd_len = int(res[0]["minPwdLength"][0]) # ticks -> days - min_pwd_age = int(abs(int(res[0]["minPwdAge"][0])) / (10e7 * 60 * 60 * 24)) - max_pwd_age = int(abs(int(res[0]["maxPwdAge"][0])) / (10e7 * 60 * 60 * 24)) + min_pwd_age = int(abs(int(res[0]["minPwdAge"][0])) / (1e7 * 60 * 60 * 24)) + max_pwd_age = int(abs(int(res[0]["maxPwdAge"][0])) / (1e7 * 60 * 60 * 24)) except: if args[0] == "show": print "ERROR: Password informations missing in your AD domain object!" @@ -153,7 +153,7 @@ elif args[0] == "set": else: min_pwd_age = int(opts.min_pwd_age) # days -> ticks - min_pwd_age = -int(min_pwd_age * (24 * 60 * 60 * 10e7)) + min_pwd_age = -int(min_pwd_age * (24 * 60 * 60 * 1e7)) m = ldb.Message() m.dn = ldb.Dn(samdb, domain_dn) @@ -168,7 +168,7 @@ elif args[0] == "set": else: max_pwd_age = int(opts.max_pwd_age) # days -> ticks - max_pwd_age = -int(max_pwd_age * (24 * 60 * 60 * 10e7)) + max_pwd_age = -int(max_pwd_age * (24 * 60 * 60 * 1e7)) m = ldb.Message() m.dn = ldb.Dn(samdb, domain_dn) -- cgit