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 <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
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":
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:
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: