summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--NEWS9
-rw-r--r--configure.in2
-rw-r--r--modules/pam_lastlog/pam_lastlog.c21
-rw-r--r--xtests/.cvsignore2
5 files changed, 35 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c52898d..46b3efb0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2006-08-24 Thorsten Kukuk <kukuk@thkukuk.de>
+ * release version 0.99.6.2
+
+ * modules/pam_lastlog/pam_lastlog.c (last_login_date): Create
+ lastlog file if it does not exist.
+
* modules/pam_cracklib/pam_cracklib.c (pam_sm_chauthtok): Check
for error from getting second token.
* xtests/Makefile.am: Add tst-pam_cracklib1
diff --git a/NEWS b/NEWS
index 7fd69027..780b545c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,11 +1,19 @@
Linux-PAM NEWS -- history of user-visible changes.
+Release 0.99.6.2
+
+* pam_lastlog: Don't refuse login if lastlog file got lost.
+* pam_cracklib: Fix a user triggerable crash.
+* documentation: Regenerate with fixed docbook stylesheet.
+
+
Release 0.99.6.1
* Fix bootstrapping problems.
* Bug fixes: pam_keyinit, pam_umask
+
Release 0.99.6.0
* pam_namespace: Code cleanup, add init script to tar archive.
@@ -14,6 +22,7 @@ Release 0.99.6.0
* Documentation: Convert sgml guides to XML, unify documentation
for PAM functions and modules.
+
Release 0.99.5.0
* pam_tally: Fix support for large UIDs
diff --git a/configure.in b/configure.in
index f917e4f3..0d59a176 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(conf/pam_conv1/pam_conv_y.y)
-AM_INIT_AUTOMAKE("Linux-PAM", 0.99.6.1)
+AM_INIT_AUTOMAKE("Linux-PAM", 0.99.6.2)
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
diff --git a/modules/pam_lastlog/pam_lastlog.c b/modules/pam_lastlog/pam_lastlog.c
index f470166f..a26b7c2e 100644
--- a/modules/pam_lastlog/pam_lastlog.c
+++ b/modules/pam_lastlog/pam_lastlog.c
@@ -12,6 +12,7 @@
#include <fcntl.h>
#include <time.h>
+#include <errno.h>
#ifdef HAVE_UTMP_H
# include <utmp.h>
#else
@@ -327,9 +328,23 @@ last_login_date(pam_handle_t *pamh, int announce, uid_t uid, const char *user)
/* obtain the last login date and all the relevant info */
last_fd = open(_PATH_LASTLOG, O_RDWR);
if (last_fd < 0) {
- pam_syslog(pamh, LOG_ERR, "unable to open %s: %m", _PATH_LASTLOG);
- D(("unable to open %s file", _PATH_LASTLOG));
- return PAM_SERVICE_ERR;
+ if (errno == ENOENT) {
+ last_fd = open(_PATH_LASTLOG, O_RDWR|O_CREAT,
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+ if (last_fd < 0) {
+ pam_syslog(pamh, LOG_ERR,
+ "unable to create %s: %m", _PATH_LASTLOG);
+ D(("unable to create %s file", _PATH_LASTLOG));
+ return PAM_SERVICE_ERR;
+ }
+ pam_syslog(pamh, LOG_WARN,
+ "file %s created", _PATH_LASTLOG);
+ D(("file %s created", _PATH_LASTLOG));
+ } else {
+ pam_syslog(pamh, LOG_ERR, "unable to open %s: %m", _PATH_LASTLOG);
+ D(("unable to open %s file", _PATH_LASTLOG));
+ return PAM_SERVICE_ERR;
+ }
}
if (lseek(last_fd, sizeof(struct lastlog) * (off_t) uid, SEEK_SET) < 0) {
diff --git a/xtests/.cvsignore b/xtests/.cvsignore
index 1a2b5211..c59c99ef 100644
--- a/xtests/.cvsignore
+++ b/xtests/.cvsignore
@@ -5,3 +5,5 @@ Makefile.in
tst-pam_dispatch1
tst-pam_dispatch2
tst-pam_dispatch3
+tst-pam_dispatch4
+tst-pam_cracklib1