'last' command 8 character username limit

'last' command 8 character username limit

Post by Kevin Cheram » Wed, 11 Sep 2002 22:36:38



What would I have to do to make the 'last' command show 16 characters
instead of 8 in the username column? I am doing this on Red Hat 7.2.
 
 
 

'last' command 8 character username limit

Post by Rich Tee » Thu, 12 Sep 2002 01:07:45



Quote:> What would I have to do to make the 'last' command show 16 characters
> instead of 8 in the username column? I am doing this on Red Hat 7.2.

Standard UNIX has an 8 character username limit (and I assume that
RedHat honours this).  I suggest you try to stick to it.

--
Rich Teer

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-online.net

 
 
 

'last' command 8 character username limit

Post by Kevin Cheram » Sun, 15 Sep 2002 06:05:51


Suggestion noted, however, what would I have to do to make the 'last'
command show 16 characters instead of 8 in the username column? I am
doing this on Red Hat 7.2.


> > What would I have to do to make the 'last' command show 16 characters
> > instead of 8 in the username column? I am doing this on Red Hat 7.2.

> Standard UNIX has an 8 character username limit (and I assume that
> RedHat honours this).  I suggest you try to stick to it.

 
 
 

'last' command 8 character username limit

Post by Rich Tee » Sun, 15 Sep 2002 07:10:32



[ Please don't top post ]

Quote:> Suggestion noted, however, what would I have to do to make the 'last'
> command show 16 characters instead of 8 in the username column? I am
> doing this on Red Hat 7.2.

Use the Source, Luke!

--
Rich Teer

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-online.net

 
 
 

'last' command 8 character username limit

Post by Dan Merc » Tue, 17 Sep 2002 00:43:55





>> What would I have to do to make the 'last' command show 16 characters
>> instead of 8 in the username column? I am doing this on Red Hat 7.2.

> Standard UNIX has an 8 character username limit (and I assume that
> RedHat honours this).  I suggest you try to stick to it.

> --
> Rich Teer

> President,
> Rite Online Inc.

> Voice: +1 (250) 979-1638
> URL: http://www.rite-online.net

Rich's warning is quite correct.  By exceeding the username limit
you may be creating buffer overrun conditions that could make your
system unstable or susceptible to attack.  You may also run into
problems with ps and many other programs that will no longer
format data correctly.

--
Dan Mercer

If responding by email, include the phrase 'from usenet'
in the subject line to avoid spam filtering.

 
 
 

'last' command 8 character username limit

Post by Sony E Anton » Tue, 17 Sep 2002 02:28:46






>>>What would I have to do to make the 'last' command show 16 characters
>>>instead of 8 in the username column? I am doing this on Red Hat 7.2.

>>Standard UNIX has an 8 character username limit (and I assume that
>>RedHat honours this).  I suggest you try to stick to it.

>>--
>>Rich Teer

>>President,
>>Rite Online Inc.

>>Voice: +1 (250) 979-1638
>>URL: http://www.rite-online.net

> Rich's warning is quite correct.  By exceeding the username limit
> you may be creating buffer overrun conditions that could make your
> system unstable or susceptible to attack.  You may also run into
> problems with ps and many other programs that will no longer
> format data correctly.

That s right. In this case utmp structure is defined as 32 bytes for
username.
( I guess they decided to have the username instead of the integer
userid, so as to close the loophole when there can be more than one
usernames associated with a userid. In this case the last command would
have been left to decide which username to show against a given userid )

Looking at the source code, it seems it processes teh /var/run/wtmp
database as if it s in new format -  32 bytes for username - unless -o
option is given. But when it prints, it always prints with "%-8.8s"
format for printf. That s why we end up seeing only the 8 characters. I
could fix this without much effort as shown below.

testingpurpose pts/3        192.168.1.252    Sun Sep 15 13:23 - 13:23
(00:00)

( Dont ask me for the changed code. Cos though it works fine, there
could be things that I overlooked and I dont want to be responsible for it )

As a side note : Another problem that comes to my mind about last

last -i will show entries like

sony     :0           172.132.4.8      Sat Sep  7 21:28    gone - no logout

I thought for a while that this is a hacker ( 172.132.4.8 was shown to
be an America Online computer as per a www.arin.net whois lookup ).
Turns out if teh login is local ( :0 for 2nd field ), then the IP
address should not be considered.

Linux produces these entries whenever you do a

/usr/bin/X11/sessreg -a -w /var/log/wtmp -u none -l :0 sony

This is done by your startup scripts

--sony

- Show quoted text -