24.05.2014 Views

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

files remain as ASCII files, but the design allows for them to be upgraded to<br />

binary files at a later date if this is found to be necessary.<br />

The /etc/passwd and /etc/security/passwd files have been indexed, and the<br />

/etc/security/lastlog file has been indexed with a corresponding change in the way<br />

that this file is processed.<br />

6.6.1 Indexing of the /etc/passwd File<br />

The actual /etc/passwd file has not been changed. However, two new files have<br />

been created, /etc/passwd.nm.idx and /etc/passwd.id.idx, through the mkpasswd<br />

command. These files are indexes created using the username (string) and the<br />

user ID (number) as keys. A record in the index file contains the key, offset of the<br />

corresponding record in the data file (/etc/passwd), and the status of the record.<br />

A negative offset value implies the corresponding record is deleted.<br />

A hook was also added at the point where the file is read to check for the<br />

existence of the index file. If the corresponding index exists, then the index read<br />

mechanism is called with the key as a parameter.<br />

6.6.2 Indexing of the /etc/security/passwd File<br />

The /etc/security/passwd file is a text file that contains one stanza for each user.<br />

It is searched one line at a time looking for the user name. Similar to the<br />

/etc/passwd file, the user name that is physically located at the top of the file is at<br />

an advantage compared to the user name at the bottom of the file. This file is also<br />

indexed by the mkpasswd command. The index is based on the username string as<br />

the key and provides an offset into the file where the stanza can be located. Once<br />

the stanza is located, it is then searched sequentially for the relevant information.<br />

6.6.3 Indexing and Locking /etc/security/lastlog File<br />

The lastlog file is a text stanza file similar to the /etc/security/passwd file that<br />

contains one stanza per user. It is accessed in a similar manner, sequentially<br />

looking for a username. However, unlike the /etc/passwd and<br />

/etc/security/passwd files, this file is accessed for update, which means that<br />

file-locking and crash-recovery must be taken into account. In the existing design,<br />

locking is done at a file-level, and the whole file is backed up, representing a<br />

major overhead. Note that there are no external commands or system and library<br />

calls to access this file. It is accessed internally by the tsmlogin() module to<br />

display lastlog information.<br />

In <strong>AIX</strong> <strong>Version</strong> <strong>4.3</strong>, the /etc/security/lastlog file remains a text file but has been<br />

changed in the following ways:<br />

Indexed access<br />

An index called /etc/security/lastlognm.id is built using the username<br />

string. This index provides the offset to a stanza. Once a stanza is<br />

located, the lines in it are processed sequentially as in <strong>AIX</strong> <strong>Version</strong><br />

4.2. The index is created by the mkpasswd command.<br />

Fixed record length<br />

Since a user stanza is updated upon login, if the file needed to be<br />

reorganized after every update (because of the variable length text<br />

fields), this would cause the record (or stanza) offsets for all stanzas<br />

after the changed stanza to be changed by a fixed delta. This would<br />

System Management and Utilities 119

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!