diff options
-rw-r--r-- | ObsoleteFiles.inc | 3 | ||||
-rw-r--r-- | include/utmp.h | 75 | ||||
-rw-r--r-- | share/man/man5/Makefile | 2 | ||||
-rw-r--r-- | share/man/man5/utmp.5 | 267 |
4 files changed, 5 insertions, 342 deletions
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index c873ab7..008b15e 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -25,6 +25,9 @@ OLD_FILES+=usr/share/man/man3/ulog_getutxuser.3.gz OLD_FILES+=usr/share/man/man3/ulog_pututxline.3.gz OLD_FILES+=usr/share/man/man3/ulog_setutxent.3.gz OLD_FILES+=usr/share/man/man3/ulog_setutxfile.3.gz +OLD_FILES+=usr/share/man/man5/lastlog.5.gz +OLD_FILES+=usr/share/man/man5/utmp.5.gz +OLD_FILES+=usr/share/man/man5/wtmp.5.gz OLD_LIBS+=lib/libutil.so.8 # 20100105: new userland semaphore implementation OLD_FILES+=usr/include/sys/semaphore.h diff --git a/include/utmp.h b/include/utmp.h index 1b57bb8..8e1363c 100644 --- a/include/utmp.h +++ b/include/utmp.h @@ -1,73 +1,2 @@ -/* - * Copyright (c) 1988, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. - * - * @(#)utmp.h 8.2 (Berkeley) 1/21/94 - * $FreeBSD$ - */ - -#ifndef _UTMP_H_ -#define _UTMP_H_ - -#define _PATH_UTMP "/var/run/utmp" -#define _PATH_WTMP "/var/log/wtmp" -#define _PATH_LASTLOG "/var/log/lastlog" - -/* - * XXX: These values are too low, but cannot be changed without breaking - * the file format. Right now pts(4) is limited to 1000 instances, - * because /dev/pts/1000 would require UT_LINESIZE to be bigger. - * UT_HOSTSIZE is also too small to hold most common hostnames or IPv6 - * addresses. - */ -#define UT_NAMESIZE 16 /* see MAXLOGNAME in <sys/param.h> */ -#define UT_LINESIZE 8 -#define UT_HOSTSIZE 16 - -struct lastlog { - int32_t ll_time; - char ll_line[UT_LINESIZE]; - char ll_host[UT_HOSTSIZE]; -}; - -struct utmp { - char ut_line[UT_LINESIZE]; - char ut_name[UT_NAMESIZE]; - char ut_host[UT_HOSTSIZE]; - int32_t ut_time; -}; - -#endif /* !_UTMP_H_ */ +/* $FreeBSD$ */ +#error "<utmp.h> has been replaced by <utmpx.h>" diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile index 615ebf1..1216fc4 100644 --- a/share/man/man5/Makefile +++ b/share/man/man5/Makefile @@ -68,7 +68,6 @@ MAN= acct.5 \ style.Makefile.5 \ sysctl.conf.5 \ tmpfs.5 \ - utmp.5 \ xfs.5 MLINKS= dir.5 dirent.5 @@ -79,7 +78,6 @@ MLINKS+=passwd.5 master.passwd.5 MLINKS+=quota.user.5 quota.group.5 MLINKS+=rc.conf.5 rc.conf.local.5 MLINKS+=resolver.5 resolv.conf.5 -MLINKS+=utmp.5 lastlog.5 utmp.5 wtmp.5 .if ${MK_HESIOD} != "no" MAN+= hesiod.conf.5 diff --git a/share/man/man5/utmp.5 b/share/man/man5/utmp.5 deleted file mode 100644 index c342041..0000000 --- a/share/man/man5/utmp.5 +++ /dev/null @@ -1,267 +0,0 @@ -.\" Copyright (c) 1980, 1991, 1993 -.\" The Regents of the University of California. All rights reserved. -.\" -.\" 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. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. -.\" -.\" @(#)utmp.5 8.2 (Berkeley) 3/17/94 -.\" $FreeBSD$ -.\" -.Dd November 14, 2001 -.Dt UTMP 5 -.Os -.Sh NAME -.Nm utmp , -.Nm wtmp , -.Nm lastlog -.Nd login records -.Sh SYNOPSIS -.In sys/types.h -.In utmp.h -.Sh DESCRIPTION -The file -.In utmp.h -declares the structures used to record information about current -users in the file -.Nm , -logins and logouts in the file -.Nm wtmp , -and last logins in the file -.Nm lastlog . -The time stamps of date changes, shutdowns and reboots are also logged in -the -.Nm wtmp -file. -.Bd -literal -offset indent -#define _PATH_UTMP "/var/run/utmp" -#define _PATH_WTMP "/var/log/wtmp" -#define _PATH_LASTLOG "/var/log/lastlog" - -#define UT_NAMESIZE 16 -#define UT_LINESIZE 8 -#define UT_HOSTSIZE 16 - -struct lastlog { - int32_t ll_time; /* When user logged in */ - char ll_line[UT_LINESIZE]; /* Terminal line name */ - char ll_host[UT_HOSTSIZE]; /* Host user came from */ -}; - -struct utmp { - char ut_line[UT_LINESIZE]; /* Terminal line name */ - char ut_name[UT_NAMESIZE]; /* User's login name */ - char ut_host[UT_HOSTSIZE]; /* Host user came from */ - int32_t ut_time; /* When user logged in */ -}; -.Ed -.Pp -The -.Nm lastlog -file is a linear array of -.Vt lastlog -structures indexed by a user's -.Tn UID . -The -.Nm -file is a linear array of -.Vt utmp -structures indexed by a terminal line number -(see -.Xr ttyslot 3 ) . -The -.Nm wtmp -file consists of -.Vt utmp -structures and is a binary log file, -that is, grows linearly at its end. -.Pp -By default, each time a user logs in, the -.Xr pam_lastlog 8 -program looks up the user's -.Tn UID -in the file -.Nm lastlog . -If it is found, the timestamp of the last time the user logged -in, the terminal line and the hostname -are written to the standard output. -The -.Xr pam_lastlog 8 -program then records the new login time in the file -.Nm lastlog . -.Pp -After the new -.Vt lastlog -record is written, -.\" the -.\" .Xr libutil 3 -.\" routine -the file -.Nm -is opened and the -.Vt utmp -record for the user is inserted. -This record remains there until -the user logs out at which time it is deleted. -The -.Nm -file is used by the programs -.Xr rwho 1 , -.Xr users 1 , -.Xr w 1 , -and -.Xr who 1 . -.Pp -Next, the -.Xr pam_lastlog 8 -program opens the file -.Nm wtmp , -and appends the user's -.Vt utmp -record. -The user's subsequent logout from the terminal -line is marked by a special -.Vt utmp -record with -.Va ut_line -set accordingly, -.Va ut_time -updated, but -.Va ut_name -and -.Va ut_host -both empty -(see -.Xr init 8 ) . -The -.Nm wtmp -file is used by the programs -.Xr last 1 -and -.Xr ac 8 . -.Pp -In the event of a date change, a shutdown or reboot, the -following items are logged in the -.Nm wtmp -file. -.Pp -.Bl -tag -width ".Li shutdown" -compact -.It Li reboot -.It Li shutdown -A system reboot or shutdown has been initiated. -The character -.Ql \&~ -is placed in the field -.Va ut_line , -and -.Li reboot -or -.Li shutdown -in the field -.Va ut_name -(see -.Xr shutdown 8 -and -.Xr reboot 8 ) . -.Pp -.It Li date -The system time has been manually or automatically updated -(see -.Xr date 1 ) . -The command name -.Li date -is recorded in the field -.Va ut_name . -In the field -.Va ut_line , -the character -.Ql \&| -indicates the time prior to the change, and the character -.Ql \&{ -indicates the new time. -.El -.Sh NOTES -The -.Nm wtmp -file can grow rapidly on busy systems, so daily or weekly rotation -is recommended. -It is maintained by -.Xr newsyslog 8 . -.Pp -If any one of these files does not exist, it is not created by -.Xr pam_lastlog 8 . -The files must be created manually. -.Pp -The supplied -.Xr login 3 , -.Xr logout 3 , -and -.Xr logwtmp 3 -utility functions should be used to perform -the standard actions on the -.Nm -and -.Nm wtmp -files in order to maintain the portability across -systems with different formats of those files. -.Sh FILES -.Bl -tag -width ".Pa /var/log/lastlog" -compact -.It Pa /var/run/utmp -The -.Nm -file. -.It Pa /var/log/wtmp -The -.Nm wtmp -file. -.It Pa /var/log/lastlog -The -.Nm lastlog -file. -.El -.Sh SEE ALSO -.Xr last 1 , -.Xr w 1 , -.Xr who 1 , -.Xr login 3 , -.Xr logout 3 , -.Xr logwtmp 3 , -.Xr ttyslot 3 , -.Xr ac 8 , -.Xr init 8 , -.Xr pam_lastlog 8 -.Sh HISTORY -A -.Nm -and -.Nm wtmp -file format appeared in -.At v6 . -The -.Nm lastlog -file format appeared in -.Bx 3.0 . |