${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
${DESTDIR}/var/log/lastlog
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
+ ${DESTDIR}/var/log/lastlogx
+ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
${DESTDIR}/var/log/messages
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
${DESTDIR}/var/log/security
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
${DESTDIR}/var/log/wtmp
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
+ ${DESTDIR}/var/log/wtmpx
+ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
${DESTDIR}/var/run/utmp
+ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
+ ${DESTDIR}/var/run/utmpx
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
${DESTDIR}/var/crash
cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
/var/log/ppp.log root:network 640 3 100 * Z
/var/log/security 600 10 100 * Z
/var/log/wtmp 644 3 * @01T05 B
+/var/log/wtmpx 644 3 * @01T05 B
/var/log/daily.log 640 7 * @T00 ZN
/var/log/weekly.log 640 5 1 $W6D0 ZN
/var/log/monthly.log 640 12 * $M1D0 ZN
CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../libc/gen/
-MAN+= flopen.3 login.3 login_auth.3 login_tty.3 logout.3 logwtmp.3 pty.3 \
+MAN+= flopen.3 login.3 loginx.3 login_auth.3 login_tty.3 logout.3 logwtmp.3 \
+ pty.3 \
login_cap.3 login_class.3 login_times.3 login_ok.3 \
_secure_path.3 uucplock.3 property.3 auth.3 realhostname.3 \
realhostname_sa.3 trimdomain.3 fparseln.3 pidfile.3 \
login_cap.3 login_getcapnum.3 login_cap.3 login_getcapsize.3 \
login_cap.3 login_getcapbool.3 login_cap.3 login_getpath.3 \
login_cap.3 login_getpwclass.3 login_cap.3 login_setcryptfmt.3
+MLINKS+=loginx.3 logoutx.3 loginx.3 logwtmpx.3
MLINKS+=login_class.3 setusercontext.3 login_class.3 setclasscontext.3 \
login_class.3 setclassenvironment.3 login_class.3 setclassresources.3
MLINKS+=login_times.3 parse_lt.3 login_times.3 in_ltm.3 \
--- /dev/null
+.\" $NetBSD: loginx.3,v 1.2 2003/04/16 13:35:15 wiz Exp $
+.\"
+.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Thomas Klausner.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd September 26, 2002
+.Dt LOGINX 3
+.Os
+.Sh NAME
+.Nm loginx ,
+.Nm logoutx ,
+.Nm logwtmpx
+.Nd login utility functions
+.Sh LIBRARY
+.Lb libutil
+.Sh SYNOPSIS
+.In util.h
+.Ft void
+.Fn loginx "const struct utmpx *ut"
+.Ft int
+.Fn logoutx "const char *line" "int status" "int type"
+.Ft void
+.Fn logwtmpx "const char *line" "const char *name" "const char *host" "int status" "int type"
+.Sh DESCRIPTION
+The
+.Fn loginx ,
+.Fn logoutx ,
+and
+.Fn logwtmpx
+operate on the
+.Xr utmpx 5
+database of currently logged in users, and the
+.Xr wtmpx 5
+database of logins and logouts.
+.Pp
+The
+.Fn loginx
+function updates the
+.Pa /var/run/utmpx
+and
+.Pa /var/log/wtmpx
+databases with the information from
+.Fa ut .
+.Pp
+.Fn logoutx
+updates the entry corresponding to
+.Fa line
+with the type and status from
+.Fa type
+and
+.Fa status .
+.Pp
+.Fn logwtmpx
+writes an entry filled with data from
+.Fa line ,
+.Fa name ,
+.Fa host ,
+.Fa status ,
+and
+.Fa type
+to the
+.Xr wtmpx 5
+database.
+.Sh RETURN VALUES
+.Fn logoutx
+returns 1 on success, and 0 if no corresponding entry was found.
+.Sh SEE ALSO
+.Xr endutxent 3 ,
+.Xr utmpx 5
utf2.5 \
utf8.5 \
utmp.5 \
+ utmpx.5 \
uuids.5 \
varsym.conf.5
MLINKS+=resolver.5 resolv.conf.5
MLINKS+=utmp.5 lastlog.5 \
utmp.5 wtmp.5
+MLINKS+=utmpx.5 lastlogx.5 \
+ utmpx.5 wtmpx.5
.include <bsd.prog.mk>
--- /dev/null
+.\" $NetBSD: utmpx.5,v 1.7 2008/04/30 13:10:57 martin Exp $
+.\"
+.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Thomas Klausner.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd January 31, 2007
+.Dt UTMPX 5
+.Os
+.Sh NAME
+.Nm utmpx ,
+.Nm wtmpx ,
+.Nm lastlogx
+.Nd user accounting database
+.Sh SYNOPSIS
+.In utmpx.h
+.Sh DESCRIPTION
+In contrast to
+.Pa utmp
+and
+.Pa wtmp ,
+the extended databases in
+.Pa utmpx
+and
+.Pa wtmpx
+reserve more space for logging hostnames, and also
+information on a process' ID, termination signal and exit status.
+.Pp
+The
+.In utmpx.h
+header defines the structures and functions for logging user.
+Currently logged in users are tracked in
+.Pa /var/run/utmpx ,
+a list of all logins and logouts, as well as all shutdowns, reboots
+and date changes, is kept in
+.Pa /var/log/wtmpx ,
+and the last login of each user is noted in
+.Pa /var/log/lastlogx .
+.Pp
+The interface to the
+.Nm utmpx
+file is described in
+.Xr getutxent 3 .
+.Pp
+The
+.Nm wtmpx
+file can grow rapidly on busy systems, and is normally rotated with
+.Xr newsyslog 8 .
+.Pp
+In the event of a date change, a shutdown, or a reboot, the following
+items are logged in the
+.Nm wtmpx
+file:
+.Bl -tag -width shutdownxx -compact -offset indent
+.It Li date
+The system time has been manually or automatically updated by
+.Xr date 1 .
+The command name
+.Em date
+is recorded in the field
+.Fa ut_name .
+In the field
+.Fa ut_line ,
+the character
+.Ql \\*(Ba
+indicates the time prior to the change, and the character
+.Ql \&{
+indicates the new time.
+.It Li reboot
+.It Li shutdown
+A system reboot or shutdown has been initiated.
+The character
+.Ql \&~
+is placed in the field
+.Fa ut_line ,
+and
+.Li reboot
+or
+.Li shutdown
+in the field
+.Fa ut_name
+(see
+.Xr shutdown 8
+and
+.Xr reboot 8 ) ,
+using
+.Xr logwtmpx 3 .
+.Pp
+.El
+.Sh FILES
+.Bl -tag -width /var/log/lastlogx -compact
+.It Pa /var/run/utmpx
+The
+.Nm utmpx
+file.
+.It Pa /var/log/wtmpx
+The
+.Nm wtmpx
+file.
+.It Pa /var/log/lastlogx
+The
+.Nm lastlogx
+file.
+.El
+.Sh SEE ALSO
+.Xr last 1 ,
+.Xr login 1 ,
+.Xr rwho 1 ,
+.Xr w 1 ,
+.Xr who 1 ,
+.Xr endutxent 3 ,
+.Xr logwtmpx 3 ,
+.Xr utmp 5 ,
+.Xr ac 8 ,
+.Xr init 8 ,
+.Xr newsyslog 8 ,
+.Xr reboot 8