Subject: bin/28751: /usr/bin/w dynamic sizing of FROM column problems
To: None <firstname.lastname@example.org, email@example.com>
From: None <firstname.lastname@example.org>
Date: 12/22/2004 08:21:00
>Synopsis: /usr/bin/w dynamic sizing of FROM column problems
>Arrival-Date: Wed Dec 22 08:21:00 +0000 2004
>Originator: Ed Ravin
NetBSD panix3.panix.com 2.0 NetBSD 2.0 (PANIX-USER) #0: Fri Dec 17 22:40:30 EST 2004 email@example.com:/devel/netbsd/2.0/src/sys/arch/i386/compile/PANIX-USER i386
we have three identical machines - on one of them, /usr/bin/w output is oddly formatted, with each line 88 characters long on an 80 column terminal. Note the user logged in from a very long rcn.com hostname - I suspect something is going on with w's attempts to dynamically size the output based on the size of the hostname in utmpx. I don't fully grok the code in w.c, but it doesn't seem to check for things like a 256 character hostname.
Also, unlike /usr/bin/last, there are no command-line options to adjust how much hostname output you want.
1:40PM up 3 days, 13:21, 123 users, load averages: 0.83, 1.78, 3.01
USER TTY FROM LOGIN@ IDLE WHAT
drewc p0 18.104.22.168 9:51AM 1:07 -tcsh
dn p1 66-108-85-142.nyc.rr.com 1:08PM 0 /usr/lo
kerausch p2 22.214.171.124 8:42AM 34 -bash
mikhail p3 whasup.com 8:54AM 59 -zsh
ahall p4 126.96.36.199 7:39AM 27 emacs -
mappel p5 207-237-134-44.c3-0.80w-ubr15.nyr-80w.ny.cable.rcn.co Sat12AM 15 pine -i
Dunno. Here are the three rcn.com hostnames that might be provoking the bug:
I note that the 2nd one above is exactly the size of the FROM field
output by w. But when I tried faking that hostname on a test box in
/etc/hosts, I couldn't reproduce the abberant behavior with the 88-column output.