Index Index for
Section 8
Index Alphabetical
listing for F
Bottom of page Bottom of
page

fwtmp(8)

NAME

fwtmp, acctwtmp, wtmpfix - Modify connect time accounting records to change formats and to make corrections in the records

SYNOPSIS

fwtmp [-ic] acctwtmp 'Reason' wtmpfix [File...]

OPTIONS

-i The fwtmp command accepts ASCII records in the type utmp structure format as input. -c The fwtmp command converts output to type utmp structure formatted binary records. -ic The fwtmp command converts ASCII type utmp structure formatted input records to binary output records.

DESCRIPTION

fwtmp [-ic] The fwtmp command reads records from standard input and writes records to standard output. Normally, information in record fields of the /var/adm/wtmp file is entered as binary data by the init and login programs during the life of the /var/adm/wtmp file. These /var/adm/wtmp file records have nine fields formatted according to members of a type utmp structure defined in the utmp.h include file. The fwtmp command is also capable of writing properly formatted ASCII records from standard input into a file when you use the -i option. Whenever you enter properly formatted ASCII records for conversion to binary records using the -i option from the standard input device, you must enter data for each field of the 9-field record in the same order as that of type utmp structure members using a space as a field separator. The following table lists record fields in the order they should be entered, the type utmp structure member name, and the purpose and entry character length. 1 ut_user The user login name, which must have exactly sizeof(ut_user) characters. 2 ut_id The inittab ID, which must have exactly sizeof(ut_id) characters. 3 ut_line The device name, which must have exactly sizeof(ut_line) characters. 4 ut_pid The process ID, which must have 5 decimal places. 5 ut_type The type of entry, which must have 2 decimal places. The type of entry may have any one of several symbolic constant values. The symbolic constants are defined in the utmp.h header file. 6 ut_exit.e_termination The process termination status, which must have 4 decimal places. 7 ut_exit.e_exit The process exit status, which must have 4 decimal places. 8 ut_time The starting time, which must have 10 decimal places. 9 ut_host The hostname, which must have exactly sizeof(ut_host) characters. All record field entries you make from standard input must be separated by a space. Also, you must fill all string fields with blank characters up to the maximum string size. All decimal values must have the specified number of decimal places with preceding 0s (zeros) to fill empty digit positions. The actual size of character arrays can be found in the utmp.h include file. acctwtmp 'Reason' The acctwtmp command is called by the runacct shell procedure to write a utmp formatted record to standard output with the current date and time together with a 'Reason' string (sizeof(ut_line) characters or less) that you must also enter. wtmpfix [File...] The wtmpfix command is called by the runacct shell procedure to examine standard input or File records in the wtmp format for corrupted date and timestamp entries. Whenever a corrupted entry is detected, the wtmpfix command corrects date and timestamp inconsistencies and writes corrected records to standard output. Whenever the acctcon1 command runs, and a date and timestamp in a /var/adm/wtmp file is incorrect, an error is generated when the first corrupted entry is encountered. The acctcon1 process is aborted whenever such an error is detected. The wtmpfix command also checks the validity of the name field to ensure that the name consists only of alphanumeric characters, a $ (dollar sign), or spaces. Whenever an invalid name is detected, the wtmpfix command changes the login name to INVALID and writes a diagnostic message to standard error. In this way, the wtmpfix command reduces the likelihood that the acctcon2 command may fail. Each time a date is entered (on system startup or with the date command) a pair of date-change records is written to the var/adm/wtmp file. The first date-change record is the old date, which is entered with the string old time (the OTIME_MSG string) in the ut_line field and the option OLD_TIME in the ut_type field. The second record is the new date, which is entered with the string new time (the NTIME_MSG string) in the ut_line field and the option NEW_TIME in the ut_type field. The wtmpfix command uses these records to synchronize all date and time stamps in the /var/adm/wtmp file. The date-change record pair is then removed.

RESTRICTIONS

You should not use the fwtmp command to correct connect-time accounting records because the utmp structure format members are not in the correct order for this operation.

EXAMPLES

1. To convert binary /var/adm/wtmp records in type utmp structure format to an ASCII file called dummy.file, enter a command similar to the following: /usr/sbin/acct/fwtmp < /var/adm/wtmp > dummy.file The content of binary file /var/adm/wtmpfile as input is redirected to dummy.file as ASCII output. 2. To convert records in an ASCII type utmp structure formatted file to a binary output file called /var/adm/wtmp, enter an fwtmp command with the -ic option similar to the following: /usr/sbin/acct/fwtmp -ic < dummy.file > /var/adm/wtmp The content of ASCII file dummy.file as input is redirected to binary file /var/adm/wtmp as output.

FILES

/usr/sbin/acct/fwtmp Specifies the command path. /usr/sbin/acct/wtmpfix Specifies the command path. /usr/sbin/acct/acctwtmp Specifies the command path. /usr/include/utmp.h Header file defining structures used to organize login information. /var/adm/utmp Database file for currently logged in users. /var/adm/wtmp Login/logout database file.

SEE ALSO

Commands: acct(8), acctcon(8), acctmerg(8), date(1), runacct(8) Functions: acct(2)

Index Index for
Section 8
Index Alphabetical
listing for F
Top of page Top of
page