Bug 673533 - 'last' command in sysVinit truncates usernames
'last' command in sysVinit truncates usernames
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: SysVinit (Show other bugs)
5.5
All Linux
low Severity medium
: rc
: ---
Assigned To: Petr Lautrbach
qe-baseos-daemons
: FutureFeature
Depends On:
Blocks: 590060
  Show dependency treegraph
 
Reported: 2011-01-28 10:47 EST by Martin Poole
Modified: 2016-04-05 07:09 EDT (History)
6 users (show)

See Also:
Fixed In Version: SysVinit-2.86-16.el5
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 550333
Environment:
Last Closed: 2011-07-21 07:01:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch to add wide capability to usernames against current rhel5 sources (3.51 KB, patch)
2011-01-28 10:48 EST, Martin Poole
no flags Details | Diff
add wide capability to usernames and domain names (3.56 KB, patch)
2011-03-31 06:12 EDT, Petr Lautrbach
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Legacy) 45656 None None None Never

  None (edit)
Description Martin Poole 2011-01-28 10:47:05 EST
+++ This bug was initially created as a clone of Bug #550333 +++

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:

--- Additional comment from plautrba@redhat.com on 2010-01-12 10:42:54 EST ---

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.

--- Additional comment from updates@fedoraproject.org on 2010-03-22 05:35:16 EDT ---

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

--- Additional comment from updates@fedoraproject.org on 2010-03-22 05:48:00 EDT ---

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

--- Additional comment from updates@fedoraproject.org on 2010-03-23 19:30:04 EDT ---

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

--- Additional comment from updates@fedoraproject.org on 2010-04-08 23:51:24 EDT ---

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.

--- Additional comment from updates@fedoraproject.org on 2010-04-10 06:14:39 EDT ---

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.
Comment 1 Martin Poole 2011-01-28 10:48:44 EST
Created attachment 475822 [details]
patch to add wide capability to usernames against current rhel5 sources
Comment 2 Petr Lautrbach 2011-03-31 06:12:07 EDT
Created attachment 489025 [details]
add wide capability to usernames and domain names

added also wide domainname output to patch from #c1 according to man page change in patch
Comment 3 RHEL Product and Program Management 2011-04-07 11:39:23 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 7 errata-xmlrpc 2011-07-21 07:01:09 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1040.html

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