svn commit: r201642 - user/ed/utmpx/lib/libpam/modules/pam_lastlog
Ed Schouten
ed at FreeBSD.org
Wed Jan 6 12:43:20 UTC 2010
Author: ed
Date: Wed Jan 6 12:43:19 2010
New Revision: 201642
URL: http://svn.freebsd.org/changeset/base/201642
Log:
Let pam_lastlog use utmpx.
Modified:
user/ed/utmpx/lib/libpam/modules/pam_lastlog/pam_lastlog.c
Modified: user/ed/utmpx/lib/libpam/modules/pam_lastlog/pam_lastlog.c
==============================================================================
--- user/ed/utmpx/lib/libpam/modules/pam_lastlog/pam_lastlog.c Wed Jan 6 12:42:46 2010 (r201641)
+++ user/ed/utmpx/lib/libpam/modules/pam_lastlog/pam_lastlog.c Wed Jan 6 12:43:19 2010 (r201642)
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
#include <pwd.h>
#include <time.h>
#include <ulog.h>
+#include <utmpx.h>
#define PAM_SM_SESSION
@@ -61,7 +62,7 @@ pam_sm_open_session(pam_handle_t *pamh,
int argc __unused, const char *argv[] __unused)
{
struct passwd *pwd;
- struct ulog_utmpx *utx;
+ struct utmpx *utx;
time_t t;
const char *user;
const void *rhost, *tty;
@@ -91,10 +92,10 @@ pam_sm_open_session(pam_handle_t *pamh,
}
if ((flags & PAM_SILENT) == 0) {
- if (ulog_setutxfile(UTXI_USER, NULL) != 0) {
- PAM_LOG("Failed to open lastlog database");
+ if (setutxdb(UTXDB_LASTLOGIN, NULL) != 0) {
+ PAM_LOG("Failed to open lastlogin database");
} else {
- utx = ulog_getutxuser(user);
+ utx = getutxuser(user);
if (utx != NULL && utx->ut_type == USER_PROCESS) {
t = utx->ut_tv.tv_sec;
if (*utx->ut_host != '\0')
@@ -104,7 +105,7 @@ pam_sm_open_session(pam_handle_t *pamh,
pam_info(pamh, "Last login: %.*s on %s",
24 - 5, ctime(&t), utx->ut_line);
}
- ulog_endutxent();
+ endutxent();
}
}
More information about the svn-src-user
mailing list