]> granicus.if.org Git - linux-pam/commitdiff
2011-05-04 Thorsten Kukuk <kukuk@thkukuk.de>
authorkukuk <kukuk@thkukuk.de>
Wed, 4 May 2011 15:26:16 +0000 (17:26 +0200)
committerkukuk <kukuk@thkukuk.de>
Wed, 4 May 2011 15:26:16 +0000 (17:26 +0200)
        * modules/pam_lastlog/pam_lastlog.c (last_login_failed): Don't
        abort with error if btmp file does not exist.

ChangeLog
modules/pam_lastlog/pam_lastlog.c

index 04072c2926fcbd929b46fca7dde416b37d8d9924..763c44e86a62e88e7af4ea63d8a9c70349cb40a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
+2011-05-04  Thorsten Kukuk  <kukuk@thkukuk.de>
+
+       * modules/pam_lastlog/pam_lastlog.c (last_login_failed): Don't
+       abort with error if btmp file does not exist.
+
 2011-03-21  Tomas Mraz  <tm@t8m.info>
+
        * modules/pam_unix/md5.c (MD5Final): Clear the whole ctx.
 
 2011-03-18  Tomas Mraz  <tm@t8m.info>
index b44c17558f8d17b9a086edb49398e4b646dad0be..9e8da7d27ca49afe36a9b2660e3024c1beb8da99 100644 (file)
@@ -403,9 +403,13 @@ last_login_failed(pam_handle_t *pamh, int announce, const char *user, time_t llt
     /* obtain the failed login attempt records from btmp */
     fd = open(_PATH_BTMP, O_RDONLY);
     if (fd < 0) {
+        int save_errno = errno;
        pam_syslog(pamh, LOG_ERR, "unable to open %s: %m", _PATH_BTMP);
        D(("unable to open %s file", _PATH_BTMP));
-       return PAM_SERVICE_ERR;
+        if (save_errno == ENOENT)
+         return PAM_SUCCESS;
+       else
+         return PAM_SERVICE_ERR;
     }
 
     while ((retval=pam_modutil_read(fd, (void *)&ut,