1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

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 <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
This commit is contained in:
Tim Beale 2018-05-03 11:48:21 +12:00 committed by Garming Sam
parent 8a105af76c
commit 0da9dbbf5a

View File

@ -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: