diff options
author | Thorsten Kukuk <kukuk@thkukuk.de> | 2006-08-24 18:01:22 +0000 |
---|---|---|
committer | Thorsten Kukuk <kukuk@thkukuk.de> | 2006-08-24 18:01:22 +0000 |
commit | 4f552174b48efdde7d47e090ebc6203657adc19b (patch) | |
tree | 3149830727becf72d4a5f0ead3d212b2ef89c6cc | |
parent | 59a0a225801c71269dc07f96df3861b74f7949e3 (diff) | |
download | pam-4f552174b48efdde7d47e090ebc6203657adc19b.tar.gz pam-4f552174b48efdde7d47e090ebc6203657adc19b.tar.bz2 pam-4f552174b48efdde7d47e090ebc6203657adc19b.zip |
Relevant BUGIDs:
Purpose of commit: bugfix
Commit summary:
---------------
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.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | NEWS | 9 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | modules/pam_lastlog/pam_lastlog.c | 21 | ||||
-rw-r--r-- | xtests/.cvsignore | 2 |
5 files changed, 35 insertions, 4 deletions
@@ -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 @@ -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 |