diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2007-07-22 15:17:29 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2007-07-22 15:17:29 +0000 |
| commit | f0f1db2e4c62ff89dcf1f4d107eed8c9eebc5e7a (patch) | |
| tree | 2d0208e823d8092ef90436fc25408dde3d9be34c /lib/libpam | |
| parent | 1173d3bb333b113fb4eb748780c6376ac2d4e57f (diff) | |
Notes
Diffstat (limited to 'lib/libpam')
| -rw-r--r-- | lib/libpam/modules/pam_lastlog/pam_lastlog.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/libpam/modules/pam_lastlog/pam_lastlog.c b/lib/libpam/modules/pam_lastlog/pam_lastlog.c index 6b07dc423801..817d1f3ba793 100644 --- a/lib/libpam/modules/pam_lastlog/pam_lastlog.c +++ b/lib/libpam/modules/pam_lastlog/pam_lastlog.c @@ -178,8 +178,11 @@ pam_sm_close_session(pam_handle_t *pamh __unused, int flags __unused, int argc __unused, const char *argv[] __unused) { const void *tty; + int pam_err; - pam_get_item(pamh, PAM_TTY, (const void **)&tty); + pam_err = pam_get_item(pamh, PAM_TTY, (const void **)&tty); + if (pam_err != PAM_SUCCESS) + goto err; if (strncmp(tty, _PATH_DEV, strlen(_PATH_DEV)) == 0) tty = (const char *)tty + strlen(_PATH_DEV); if (*(const char *)tty == '\0') @@ -189,6 +192,11 @@ pam_sm_close_session(pam_handle_t *pamh __unused, int flags __unused, __func__, (const char *)tty); logwtmp(tty, "", ""); return (PAM_SUCCESS); + + err: + if (openpam_get_option(pamh, "no_fail")) + return (PAM_SUCCESS); + return (pam_err); } PAM_MODULE_ENTRY("pam_lastlog"); |
