Check time when getting UserLockedForFailedAttempt

In pam_tally2, the user is unlocked after unlock_time seconds. But
phosphor-user-manager only checks the login failure attempts and sets
UserLockedForFailedAttempt to true when it exceeds the max attempts
allowed. This patch fixes this issue by adding a comparison of current
time and the last login failure time.

Tested:
Login with wrong password for {MaxLoginAttemptBeforeLockout} times,
verified UserLockedForFailedAttempt is changed to true. Then wait for
{AccountUnlockTimeout} seconds, it becomes to false.

Change-Id: If8427e5644e0cd88758b0266973feb50a9831fe1
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
1 file changed