From 0da9dbbf5a762f0953f1860b8b04810d33557094 Mon Sep 17 00:00:00 2001 From: Tim Beale Date: Thu, 3 May 2018 11:48:21 +1200 Subject: [PATCH] netcmd: Small tweak to retrieving pwdProperties Currently the 'samba-tool domain passwordsettings' command shares a 'set' and 'show' option, but there is very little common code between the two. The only variable that's shared is pwd_props, but there's a separate API we can use to get this. This allows us to split the command into a super-command in a subsequent patch. Fixed up erroneous comments while I'm at it. Reviewed-by: Andrew Bartlett Reviewed-by: Garming Sam Signed-off-by: Tim Beale --- python/samba/netcmd/domain.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index da617110010..8b34bfd0f3f 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -1367,6 +1367,7 @@ class cmd_domain_passwordsettings(Command): msgs = [] m = ldb.Message() m.dn = ldb.Dn(samdb, domain_dn) + pwd_props = int(samdb.get_pwdProperties()) if complexity is not None: if complexity == "on" or complexity == "default": @@ -1458,7 +1459,7 @@ class cmd_domain_passwordsettings(Command): if account_lockout_duration < 0 or account_lockout_duration > 99999: raise CommandError("Maximum password age must be in the range of 0 to 99999!") - # days -> ticks + # minutes -> ticks if account_lockout_duration == 0: account_lockout_duration_ticks = -0x8000000000000000 else: @@ -1487,7 +1488,7 @@ class cmd_domain_passwordsettings(Command): if reset_account_lockout_after < 0 or reset_account_lockout_after > 99999: raise CommandError("Maximum password age must be in the range of 0 to 99999!") - # days -> ticks + # minutes -> ticks if reset_account_lockout_after == 0: reset_account_lockout_after_ticks = -0x8000000000000000 else: -- 2.34.1