commit 6ee536baa197e2d78019e6eab3990c0b9d367fb8
Author: kukuk <kukuk(a)thkukuk.de>
Date: Wed May 4 17:26:16 2011 +0200
2011-05-04 Thorsten Kukuk <kukuk(a)thkukuk.de>
* modules/pam_lastlog/pam_lastlog.c (last_login_failed): Don't
abort with error if btmp file does not exist.
ChangeLog | 6 ++++++
modules/pam_lastlog/pam_lastlog.c | 6 +++++-
2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 04072c2..763c44e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
+2011-05-04 Thorsten Kukuk <kukuk(a)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(a)t8m.info>
+
* modules/pam_unix/md5.c (MD5Final): Clear the whole ctx.
2011-03-18 Tomas Mraz <tm(a)t8m.info>
diff --git a/modules/pam_lastlog/pam_lastlog.c b/modules/pam_lastlog/pam_lastlog.c
index b44c175..9e8da7d 100644
--- a/modules/pam_lastlog/pam_lastlog.c
+++ b/modules/pam_lastlog/pam_lastlog.c
@@ -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,
Show replies by date