mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
rpcserver: login_password datetime fix in expiration check
krbpasswordexpiration conversion to time failed because now we get datetime object instead of string. https://fedorahosted.org/freeipa/ticket/4339 Reviewed-By: Tomas Babej <tbabej@redhat.com>
This commit is contained in:
parent
988b2cebf4
commit
1e96475a77
@ -28,7 +28,6 @@ from xmlrpclib import Fault
|
||||
import os
|
||||
import datetime
|
||||
import urlparse
|
||||
import time
|
||||
import json
|
||||
|
||||
from ipalib import plugable, errors
|
||||
@ -959,13 +958,8 @@ class login_password(Backend, KerberosSession, HTTP_Status):
|
||||
['krbpasswordexpiration'])
|
||||
if 'krbpasswordexpiration' in entry_attrs:
|
||||
expiration = entry_attrs['krbpasswordexpiration'][0]
|
||||
try:
|
||||
exp = time.strptime(expiration, '%Y%m%d%H%M%SZ')
|
||||
if exp <= time.gmtime():
|
||||
reason = 'password-expired'
|
||||
except ValueError, v:
|
||||
self.error('Unable to convert %s to a time string'
|
||||
% expiration)
|
||||
if expiration <= datetime.datetime.now():
|
||||
reason = 'password-expired'
|
||||
|
||||
except Exception:
|
||||
# It doesn't really matter how we got here but the user's
|
||||
|
Loading…
Reference in New Issue
Block a user