Description of problem:
The GNU acct package includes a version of the last command that is still actively developed (last ChangeLog entry is Aug 2009). In that package, the 'last' command includes a non-documented option -w or --wide that changes the length of the user name column from 8 to 8+ characters.
The SysVInit package that has been included in Red Hat Enterprise Linux, Fedora, and all the Red Hat based distros (like CentOS) has not been changed apparently since 2004. The version of 'last' in the sysvinit version does not include the wide option.
This bug affects modern Linux systems and system administration as using last to view current and previous logins will display a truncated username if the username is over 8 characters long. The Red Hat version of last does NOT substitute UID in place of Username in cases where the Username is > 8 characters.
Given two usernames, michelleharris and michelleharrison, if both have recently logged in, their entires in wtmp will show (using strings on the wtmp file) their full user names. HOWEVER, if you try to view recent logins via the 'last' command, you will see the usernames truncated and impossible to differentiate:
The expected outcome would be either an inclusion of the -w / --wide option from GNU's acct 'last' command, or substituting the UID for Username in 'last' output when the username is longer than 8 characters.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create two user accounts where the first 8 characters are similar:
2. log each user in via separate means (tty, local, whatever)
3. run strings against /var/log/wtmp and note that the entires for each user's login show the full usernames.
4. run 'last' and note that the user names are truncated to 8 characters and both display the username michelle though they are, in reality, two different user accounts.
Usernames are truncated to 8 characters
Either a -w / --wide option to display full usernames in the output of 'last' or logic that subs UID for username when username is > 8 characters
Created attachment 383263 [details]
add lst -w option for wide output
This patch adds -w options to last command. With this option are not cut down user and domain names in output.
http://koji.fedoraproject.org/koji/taskinfo?taskID=1916831 scratch build with applied patch, please test whether it's suitable for you.
sysvinit-2.87-3.dsf.fc12 has been submitted as an update for Fedora 12.
sysvinit-2.87-3.dsf.fc13 has been submitted as an update for Fedora 13.
sysvinit-2.87-3.dsf.fc12 has been pushed to the Fedora 12 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
su -c 'yum --enablerepo=updates-testing update sysvinit'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/sysvinit-2.87-3.dsf.fc12
sysvinit-2.87-3.dsf.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.
sysvinit-2.87-3.dsf.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.