summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/pwpolicy.py
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2013-08-05 13:45:26 +0200
committerMartin Kosek <mkosek@redhat.com>2013-08-05 17:50:31 +0200
commitf954f2d1b92db10113b766759897d66c57e1e3ab (patch)
tree54a371a135674bfd8a9923b8a0e661494dcd7416 /ipalib/plugins/pwpolicy.py
parent5d141bd39cb99f2c2e16b61bcc4e06b734bbab04 (diff)
downloadfreeipa-f954f2d1b92db10113b766759897d66c57e1e3ab.tar.gz
freeipa-f954f2d1b92db10113b766759897d66c57e1e3ab.tar.xz
freeipa-f954f2d1b92db10113b766759897d66c57e1e3ab.zip
Limit pwpolicy maxlife to 20000 days
Since krbMaxPwdLife attribute is represented as number of seconds, setting maxlife to high values such as 999 999 days (~2739 years) would result to overflow when parsing this attribute in kdb plugin, and hence default maxlife of 90 days would be applied. Limit the maximum value of maxlife that can be set through the framework to 20 000 days (~ 54 years). https://fedorahosted.org/freeipa/ticket/3817
Diffstat (limited to 'ipalib/plugins/pwpolicy.py')
-rw-r--r--ipalib/plugins/pwpolicy.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/ipalib/plugins/pwpolicy.py b/ipalib/plugins/pwpolicy.py
index 9bbecf7cb..da24f7c49 100644
--- a/ipalib/plugins/pwpolicy.py
+++ b/ipalib/plugins/pwpolicy.py
@@ -235,6 +235,7 @@ class pwpolicy(LDAPObject):
label=_('Max lifetime (days)'),
doc=_('Maximum password lifetime (in days)'),
minvalue=0,
+ maxvalue=20000, # a little over 54 years
),
Int('krbminpwdlife?',
cli_name='minlife',