Bug 550333

Summary: 'last' command in sysVinit truncates usernames
Product: [Fedora] Fedora Reporter: Jeff Lane <jeff>
Component: sysvinitAssignee: Petr Lautrbach <plautrba>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: notting, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sysvinit-2.87-3.dsf.fc12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 585907 673533 (view as bug list) Environment:
Last Closed: 2010-04-10 10:14:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 585907    
Attachments:
Description Flags
add lst -w option for wide output none

Description Jeff Lane 2009-12-24 15:10:41 UTC
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.

For example:

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:

michelle
michelle

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):
sysvinit-2.86

How reproducible:
Easily

Steps to Reproduce:
1. Create two user accounts where the first 8 characters are similar:
   michelleharris
   michelleharrison
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.

  
Actual results:
Usernames are truncated to 8 characters

Expected results:
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

Additional info:

Comment 1 Petr Lautrbach 2010-01-12 15:42:54 UTC
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.

Comment 2 Fedora Update System 2010-03-22 09:35:16 UTC
sysvinit-2.87-3.dsf.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/sysvinit-2.87-3.dsf.fc12

Comment 3 Fedora Update System 2010-03-22 09:48:00 UTC
sysvinit-2.87-3.dsf.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/sysvinit-2.87-3.dsf.fc13

Comment 4 Fedora Update System 2010-03-23 23:30:04 UTC
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

Comment 5 Fedora Update System 2010-04-09 03:51:24 UTC
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.

Comment 6 Fedora Update System 2010-04-10 10:14:39 UTC
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.