Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 May 2014 17:57:42 -0400
From:      Matthew Pounsett <matt@conundrum.com>
To:        "freebsd-questions@freebsd.org Mailing List" <freebsd-questions@freebsd.org>
Subject:   w and who can't display bare IPv6 source addresses
Message-ID:  <0936E004-7D01-4182-B52C-EAD6AE896D43@conundrum.com>

next in thread | raw e-mail | index | archive | help

On a FreeBSD 9.2 system, it looks like =91w=92 and =91who=92 have a =
collection of bugs that conspire to prevent the display of a complete =
IPv6 address.  I=92m wondering if there are known workarounds for this, =
and whether people think this should be one big PR or not=85

First off, =91w -n=92 is ignored in all cases (this is true for v4 and =
v6):

> w -n
 9:38PM  up 106 days, 22:23, 2 users, load averages: 0.00, 0.00, 0.00
USER       TTY      FROM                      LOGIN@  IDLE WHAT
matt       pts/0    2001:4900:1044:0:2808:f1  9:38PM     - -tcsh (tcsh)
matt       pts/1    kaywinnit.conundrum.com   9:38PM     - w -n

One of those logins is from a host with reverse DNS, the other without.  =
That part is a clear bug.

I will also point out that the address without rev DNS is incomplete.  =
This is the other problem=85 w is not able to readjust for long field =
lengths.  Widening the terminal doesn=92t help.  And, it seems that =91w=92=
 doesn=92t pay attention to the COLUMNS environment variable defined by =
environ(7)=85 at least not for widening the display.  This seems like at =
least a design flaw, if not a bug.

=91who=92 can display a whole IPv6 address in its output if you happen =
to not have reverse DNS.  But, who doesn=92t implement -n at all, so if =
an address has reverse DNS, you=92re stuck.  A full 39-character string =
representation of an IPv6 address would pad the below line out to =
exactly 80 columns, so despite the fact that who=92s man page says it =
listens to the COLUMNS environment variable, it doesn=92t need to for =
extending the line .. it would fit into a typical 80-column layout =
anyway. =85 if only -n existed.  The absence of -n here also seems like =
a design flaw.

> who
matt             pts/0    May  1 21:38 =
(2001:4900:1044:0:2808:f1c9:e677:5045)
matt             pts/1    May  1 21:38 (kaywinnit.conundrum.com)

Does this make sense to anyone else?  Should I file a couple PRs about =
these tools?





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0936E004-7D01-4182-B52C-EAD6AE896D43>