@@ -, +, @@ --- modules/pam_lastlog/pam_lastlog.c | 5 +++++ modules/pam_rhosts/pam_rhosts.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) --- a/modules/pam_lastlog/pam_lastlog.c +++ a/modules/pam_lastlog/pam_lastlog.c @@ -26,6 +26,7 @@ #include #include #include +#include #if defined(hpux) || defined(sunos) || defined(solaris) # ifndef _PATH_LASTLOG @@ -403,7 +404,9 @@ last_login_write(pam_handle_t *pamh, int announce, int last_fd, if (announce & LASTLOG_WTMP) { /* write wtmp entry for user */ +#ifdef HAVE_LOGWTMP logwtmp(last_login.ll_line, user, remote_host); +#endif } /* cleanup */ @@ -714,7 +717,9 @@ pam_sm_close_session (pam_handle_t *pamh, int flags, terminal_line = get_tty(pamh); /* Wipe out utmp logout entry */ +#ifdef HAVE_LOGWTMP logwtmp(terminal_line, "", ""); +#endif return PAM_SUCCESS; } --- a/modules/pam_rhosts/pam_rhosts.c +++ a/modules/pam_rhosts/pam_rhosts.c @@ -112,8 +112,10 @@ int pam_sm_authenticate (pam_handle_t *pamh, int flags, int argc, #ifdef HAVE_RUSEROK_AF retval = ruserok_af (rhost, as_root, ruser, luser, PF_UNSPEC); -#else +#elif HAVE_RUSEROK retval = ruserok (rhost, as_root, ruser, luser); +#else + retval = 1; #endif if (retval != 0) { if (!opt_silent || opt_debug) --