rpcserver: fix local vs utc time comparison

login_password did not work properly in timezones other than +0h because
local time was compared with utc time.

Bug introduced in:
https://fedorahosted.org/freeipa/ticket/4339

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
Petr Vobornik 2014-06-24 15:54:41 +02:00
parent 70c77e6a3c
commit 1c94edd3a0

View File

@ -959,7 +959,7 @@ class login_password(Backend, KerberosSession, HTTP_Status):
['krbpasswordexpiration'])
if 'krbpasswordexpiration' in entry_attrs:
expiration = entry_attrs['krbpasswordexpiration'][0]
if expiration <= datetime.datetime.now():
if expiration <= datetime.datetime.utcnow():
reason = 'password-expired'
except Exception: