From owner-freebsd-questions@FreeBSD.ORG Thu May 1 21:57:51 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E419C459 for ; Thu, 1 May 2014 21:57:51 +0000 (UTC) Received: from kaywinnit.conundrum.com (smtp.conundrum.com [IPv6:2001:4900:1:213::2:20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C15E211B0 for ; Thu, 1 May 2014 21:57:51 +0000 (UTC) Received: from tor-gateway.afilias.info ([199.15.87.4] helo=[10.10.66.12]) by kaywinnit.conundrum.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.82 (FreeBSD)) (envelope-from ) id 1WfyzE-000BZr-FL; Thu, 01 May 2014 21:57:48 +0000 From: Matthew Pounsett Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Date: Thu, 1 May 2014 17:57:42 -0400 Subject: w and who can't display bare IPv6 source addresses To: "freebsd-questions@freebsd.org Mailing List" Message-Id: <0936E004-7D01-4182-B52C-EAD6AE896D43@conundrum.com> Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) X-Mailer: Apple Mail (2.1874) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 21:57:52 -0000 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?