From owner-svn-src-all@FreeBSD.ORG Wed Jan 13 18:32:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CFE5106566C; Wed, 13 Jan 2010 18:32:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C4548FC1B; Wed, 13 Jan 2010 18:32:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0DIWVdE088210; Wed, 13 Jan 2010 18:32:31 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0DIWVtl088208; Wed, 13 Jan 2010 18:32:31 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001131832.o0DIWVtl088208@svn.freebsd.org> From: Ed Schouten Date: Wed, 13 Jan 2010 18:32:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202211 - head/lib/libpam/modules/pam_lastlog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2010 18:32:31 -0000 Author: ed Date: Wed Jan 13 18:32:31 2010 New Revision: 202211 URL: http://svn.freebsd.org/changeset/base/202211 Log: Let pam_lastlog use utmpx instead of libulog's utmpx interface. It will still use ulog_login(3) and ulog_logout(3), which will remain present. Modified: head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Modified: head/lib/libpam/modules/pam_lastlog/pam_lastlog.c ============================================================================== --- head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Wed Jan 13 18:28:58 2010 (r202210) +++ head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Wed Jan 13 18:32:31 2010 (r202211) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #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(); } }