Bug 550333 - 'last' command in sysVinit truncates usernames
Summary: 'last' command in sysVinit truncates usernames
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: sysvinit
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Petr Lautrbach
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 585907
TreeView+ depends on / blocked
 
Reported: 2009-12-24 15:10 UTC by Jeff Lane
Modified: 2010-04-26 11:45 UTC (History)
2 users (show)

Fixed In Version: sysvinit-2.87-3.dsf.fc12
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 585907 673533 (view as bug list)
Environment:
Last Closed: 2010-04-10 10:14:45 UTC
Type: ---


Attachments (Terms of Use)
add lst -w option for wide output (3.97 KB, patch)
2010-01-12 15:42 UTC, Petr Lautrbach
no flags Details | Diff

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.


Note You need to log in before you can comment on or make changes to this bug.