Bug 172247 - last(1) only prints first 8 chars of username
last(1) only prints first 8 chars of username
Status: CLOSED DUPLICATE of bug 121426
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: SysVinit (Show other bugs)
3.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
(none)
: Security
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-01 16:47 EST by Adam Thompson
Modified: 2014-03-16 22:56 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-11-01 16:52:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Adam Thompson 2005-11-01 16:47:28 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

Description of problem:
/usr/include/bits/utmp.h: #define UT_NAMESIZE     32

but... in last.c (from sysvinit sources) enforcese a %8.8 format mask for usernames.

Since we have longer usernames now (courtesy winbind), last has suddenly become useless.  The name of our domain is longer than 8 characters, so although the information is there in the utmp file, last can't display it!


Version-Release number of selected component (if applicable):
SysVinit-2.85-4

How reproducible:
Always

Steps to Reproduce:
1. Enable winbindd
2. Set "utmp = yes" in smb.conf
3. Run "last"
4. See useless output :-(


Actual Results:  [root@Vailtech root]# last
root     pts/0        corporate.dryden Tue Nov  1 15:40   still logged in   
DRYDENDO smb/4        10.0.1.56        Tue Nov  1 15:29   still logged in   
DRYDENDO smb/3        10.0.1.52        Tue Nov  1 15:26   still logged in   
root     pts/0        10.0.1.91        Tue Nov  1 15:24 - 15:27  (00:03)    
DRYDENDO smb/1        10.0.1.51        Tue Nov  1 15:22   still logged in   
DRYDENDO smb/1        10.0.1.51        Tue Nov  1 15:22 - 15:22  (00:00)    
root     smb/1        10.0.1.51        Tue Nov  1 15:21 - 15:21  (00:00)    
DRYDENDO smb/2        10.0.50.235      Tue Nov  1 15:19   still logged in   
DRYDENDO smb/1        10.0.1.51        Tue Nov  1 15:16 - 15:20  (00:03)    
root     pts/0        corporate.dryden Tue Nov  1 13:26 - 15:19  (01:52)    



Expected Results:  [root@Vailtech root]# widelast
root                             pts/0        corporate.dryden Tue Nov  1 15:40   still logged in   
DRYDENDOMAIN\jsalina             smb/4        10.0.1.56        Tue Nov  1 15:29   still logged in   
DRYDENDOMAIN\jburgstaler         smb/3        10.0.1.52        Tue Nov  1 15:26   still logged in   
root                             pts/0        10.0.1.91        Tue Nov  1 15:24 - 15:27  (00:03)    
DRYDENDOMAIN\dsmith              smb/1        10.0.1.51        Tue Nov  1 15:22   still logged in   
DRYDENDOMAIN\dsmith              smb/1        10.0.1.51        Tue Nov  1 15:22 - 15:22  (00:00)    
root                             smb/1        10.0.1.51        Tue Nov  1 15:21 - 15:21  (00:00)    
DRYDENDOMAIN\lrobinson           smb/2        10.0.50.235      Tue Nov  1 15:19   still logged in   
DRYDENDOMAIN\dsmith              smb/1        10.0.1.51        Tue Nov  1 15:16 - 15:20  (00:03)    
root                             pts/0        corporate.dryden Tue Nov  1 13:26 - 15:19  (01:52)    


Additional info:

Easily fixed:
    sed -e 's/%8.8/%32.2/' last.c

I'm sure that would break something else somewhere, so possibly a new command-line switch that causes printf to use "%UT_NAMESIZE.UT_NAMESIZE" instead of "%8.8" ?
Comment 1 Bill Nottingham 2005-11-01 16:52:07 EST

*** This bug has been marked as a duplicate of 121426 ***

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