X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=driver%2Fpasswd.c;h=ac5a3f0f546aeda1335c372f687fc85cb61a704b;hp=fd42c5521351da99fa65a2584e8debe429bd7789;hb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;hpb=dba664f31aa87285db4d76cf8c5e66335299703a diff --git a/driver/passwd.c b/driver/passwd.c index fd42c552..ac5a3f0f 100644 --- a/driver/passwd.c +++ b/driver/passwd.c @@ -1,5 +1,5 @@ /* passwd.c --- verifying typed passwords with the OS. - * xscreensaver, Copyright (c) 1993-2004 Jamie Zawinski + * xscreensaver, Copyright (c) 1993-2014 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -22,6 +22,8 @@ #ifdef HAVE_UNISTD_H # include #endif +#include +#include #ifndef VMS # include /* for getpwuid() */ @@ -322,6 +324,9 @@ xss_authenticate(saver_info *si, Bool verbose_p) if (si->unlock_state == ul_fail) { + /* Note the time of the first failure */ + if (si->unlock_failures == 0) + si->unlock_failure_time = time((time_t *) 0); si->unlock_failures++; do_syslog (si, verbose_p); }