Skip to content

Commit 4e18d97

Browse files
committed
Uses correct zero value for lgpo LockoutDuration
Fixes saltstack#56406
1 parent 0354421 commit 4e18d97

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

salt/modules/win_lgpo.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2615,12 +2615,18 @@ def __init__(self):
26152615
"lgpo_section": self.account_lockout_policy_gpedit_path,
26162616
"Settings": {
26172617
"Function": "_in_range_inclusive",
2618-
"Args": {"min": 0, "max": 6000000},
2618+
"Args": {
2619+
"min": 0,
2620+
"max": 6000000,
2621+
"zero_value": 0xFFFFFFFF,
2622+
},
26192623
},
26202624
"NetUserModal": {"Modal": 3, "Option": "lockout_duration"},
26212625
"Transform": {
26222626
"Get": "_seconds_to_minutes",
26232627
"Put": "_minutes_to_seconds",
2628+
"GetArgs": {"zero_value": 0xFFFFFFFF},
2629+
"PutArgs": {"zero_value": 0xFFFFFFFF},
26242630
},
26252631
},
26262632
"LockoutThreshold": {
@@ -4252,7 +4258,10 @@ def _seconds_to_minutes(cls, val, **kwargs):
42524258
"""
42534259
converts a number of seconds to minutes
42544260
"""
4261+
zero_value = kwargs.get("zero_value", 0)
42554262
if val is not None:
4263+
if val == zero_value:
4264+
return 0
42564265
return val / 60
42574266
else:
42584267
return "Not Defined"
@@ -4262,7 +4271,10 @@ def _minutes_to_seconds(cls, val, **kwargs):
42624271
"""
42634272
converts number of minutes to seconds
42644273
"""
4274+
zero_value = kwargs.get("zero_value", 0)
42654275
if val is not None:
4276+
if val == 0:
4277+
return zero_value
42664278
return val * 60
42674279
else:
42684280
return "Not Defined"

0 commit comments

Comments
 (0)