fwtmp(8) CLIX fwtmp(8)
NAME
fwtmp, wtmpfix - Manipulates connect-time accounting records
SYNOPSIS
/usr/lib/acct/fwtmp [-ic]
/usr/lib/acct/wtmpfix [file ... ]
FLAGS
-i Specifies that input is in ASCII form.
-c Specifies that output is in binary form.
DESCRIPTION
The fwtmp command reads from stdin, converts binary records of the type
found in the /etc/wtmp file to formatted ASCII records (see utmp(4)), and
writes to stdout.
The wtmpfix command examines stdin or the specified files, which are to be
in utmp format, modifies the time and date stamps to make the entries
consistent, and writes to stdout. A minus sign (-) may be used instead of
a filename to indicate stdin. If the time and date stamps are not
modified, the acctcon command will abort when it encounters certain date-
change records.
Each time the date is set, a pair of date change records are written to
the /etc/wtmp file. The first record is the old date denoted by the
string ``old time'' placed in the line field and the flag OLD_TIME placed
in the type field of the utmp structure. The second record specifies the
new date and is denoted by the string ``new time'' placed in the line
field and the flag NEW_TIME placed in the type field. The wtmpfix command
uses these records to synchronize all time stamps in the file.
In addition to modifying time and date stamps, wtmpfix checks the validity
of the name field to ensure that it consists solely of alphanumeric
characters or spaces. If it encounters an invalid name, it changes the
login name to INVALID and writes a diagnostic message to stderr. In this
way, wtmpfix reduces the chance that acctcon will fail when processing
connect-time accounting records.
EXAMPLES
1. This example removes lines prior to a date change in the wtmp file.
The input is in ASCII form and the output is in binary form.
fwtmp < /etc/wtmp | sed '1,/new date/d' | fwtmp -ic > xwtmp
2/94 - Intergraph Corporation 1
fwtmp(8) CLIX fwtmp(8)
2. This example verifies the integrity of the /etc/wtmp file.
wtmpfix < /etc/wtmp > tmpwtmp
FILES
/etc/wtmp Login/logout history file.
DIAGNOSTICS
The wtmpfix command displays an error message if it is unable to open or
read from stdin. It also displays the following error messages if the
file being fixed is not as expected: ``New date expected at offset xxx''
or ``Input truncated at offset xxx''.
The fwtmp command displays no messages.
EXIT VALUES
The wtmpfix command exits with a value of 1 if it encounters a problem.
It exits with a value of 0 is no problem is encountered.
RELATED INFORMATION
Commands: acct(8), acctcon(8), acctcms(8), acctmerg(8), acctprc(8),
acctsh(8), runacct(8), acctcom(8)
Functions: acct(2)
Files: acct(4), utmp(4)
2 Intergraph Corporation - 2/94