summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/pwpolicy.py
diff options
context:
space:
mode:
Diffstat (limited to 'ipalib/plugins/pwpolicy.py')
-rw-r--r--ipalib/plugins/pwpolicy.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/ipalib/plugins/pwpolicy.py b/ipalib/plugins/pwpolicy.py
index 53989def..7a83216f 100644
--- a/ipalib/plugins/pwpolicy.py
+++ b/ipalib/plugins/pwpolicy.py
@@ -64,6 +64,7 @@ from ipalib import Int, Str
from ipalib.plugins.baseldap import *
from ipalib import _
from ipapython.ipautil import run
+from distutils import version
class cosentry(LDAPObject):
"""
@@ -171,12 +172,17 @@ class pwpolicy(LDAPObject):
'krbpwdmaxfailure', 'krbpwdfailurecountinterval',
'krbpwdlockoutduration',
]
+ MIN_KRB5KDC_WITH_LOCKOUT = "1.8"
has_lockout = False
lockout_params = ()
+
(stdout, stderr, rc) = run(['klist', '-V'], raiseonerr=False)
if rc == 0:
- if stdout.find('version 1.8') > -1:
- has_lockout = True
+ verstr = stdout.split()[-1]
+ ver = version.LooseVersion(verstr)
+ min = version.LooseVersion(MIN_KRB5KDC_WITH_LOCKOUT)
+ if ver >= min:
+ has_lockout = True
if has_lockout:
lockout_params = (