summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorTim Beale <timbeale@catalyst.net.nz>2019-04-03 09:10:55 +1300
committerKarolin Seeger <kseeger@samba.org>2019-05-14 17:36:28 +0000
commit893ac2a6b2046e4e1d7a46f2a2c50afc7546d3b2 (patch)
treebce2713e42e5c2dc2bb550bed1361d466b760191 /selftest
parentafc2243b4785180c74bccaa5491396fe7d5d8bcd (diff)
downloadsamba-893ac2a6b2046e4e1d7a46f2a2c50afc7546d3b2.tar.gz
netcmd: Fix passwordsettings --max-pwd-age command
The min_pwd_age and max_pwd_age parameters are both optional and default to None. However, if we just set the max-pwd-age, then the check 'min_pwd_age >= max_pwd_age' will throw a Python exception because it's trying to compare an int to NoneType (min_pwd_age). This works on Python 2 but is a problem on Python 3. We could just add a check that min_pwd_age is not None, but that defeats the point of having the check if you're only setting either the min or max age indepedently. This patch gets the current min/max password age from the DB (in ticks). If either setting is changed, the ticks will be updated. Then at the end we check the min is still less than the max (to do this, we convert the ticks back to days in the interests of readability). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13873 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Apr 5 08:03:08 UTC 2019 on sn-devel-144 (cherry picked from commit 7a410ccb5f6f2958d56fa6f16d8780c69a3830dd) Autobuild-User(v4-10-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-10-test): Tue May 14 17:36:28 UTC 2019 on sn-devel-144
Diffstat (limited to 'selftest')
-rw-r--r--selftest/knownfail.d/passwordsettings1
1 files changed, 0 insertions, 1 deletions
diff --git a/selftest/knownfail.d/passwordsettings b/selftest/knownfail.d/passwordsettings
deleted file mode 100644
index 8e94cefa9a8..00000000000
--- a/selftest/knownfail.d/passwordsettings
+++ /dev/null
@@ -1 +0,0 @@
-samba.tests.samba_tool.passwordsettings.samba.tests.samba_tool.passwordsettings.PwdSettingsCmdTestCase.test_domain_passwordsettings_pwdage\(ad_dc_default:local\)