From owner-svn-src-head@FreeBSD.ORG Wed Nov 25 17:15:32 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 458D3106566B; Wed, 25 Nov 2009 17:15:32 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from asuka.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) by mx1.freebsd.org (Postfix) with ESMTP id A9CEC8FC1C; Wed, 25 Nov 2009 17:15:31 +0000 (UTC) Received: from yuga.mahoroba.org (ume@yuga.mahoroba.org [IPv6:2001:2f0:104:8010:21b:d3ff:fe38:5381]) (user=ume mech=CRAM-MD5 bits=0) by asuka.mahoroba.org (8.14.3/8.14.3) with ESMTP/inet6 id nAPHFN7C092915 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Nov 2009 02:15:24 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Thu, 26 Nov 2009 02:15:23 +0900 Message-ID: From: Hajimu UMEMOTO To: Juli Mallett In-Reply-To: References: <200911221651.nAMGpiIO023873@svn.freebsd.org> User-Agent: xcite1.58> Wanderlust/2.15.7 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.7 Emacs/23.1 (i386-portbld-freebsd8.0) MULE/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 8.0-RELEASE X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE Organization: Internet Mutual Aid Society, YOKOHAMA MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.3 (asuka.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Thu, 26 Nov 2009 02:15:24 +0900 (JST) X-Virus-Scanned: clamav-milter 0.95.3 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on asuka.mahoroba.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r199655 - head/usr.bin/w X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 17:15:32 -0000 Hi, >>>>> On Wed, 25 Nov 2009 08:31:03 -0800 >>>>> Juli Mallett said: jmallett> This catches hostnames that have been truncated but ignores hostnames jmallett> that would have been truncated if they were still one letter longer. jmallett> In any event, it generates traffic if '-n' is specified and tries to jmallett> use the resolver, which is undesirable to at least me and DES. Some people think it was regression. So, I made this change. It is useful that -n means don't resolve at all, as you think. And, we already familiar with the behavior these days. But, the commit log of 1.48 didn't say it is a reason for the change. Then, how about this patch? It introduces -nn to resolve hostname in utmp. Index: usr.bin/w/w.1 diff -u usr.bin/w/w.1.orig usr.bin/w/w.1 --- usr.bin/w/w.1.orig 2009-10-25 10:10:29.000000000 +0900 +++ usr.bin/w/w.1 2009-11-26 02:00:28.970109388 +0900 @@ -81,6 +81,10 @@ Do not attempt to resolve network addresses (normally .Nm interprets addresses and attempts to display them as names). +When +.Fl n +is specified more than once, hostnames stored in utmp are attempted to +resolve to display them as network addresses. .El .Pp If one or more Index: usr.bin/w/w.c diff -u -p usr.bin/w/w.c.orig usr.bin/w/w.c --- usr.bin/w/w.c.orig 2009-11-21 20:28:57.000000000 +0900 +++ usr.bin/w/w.c 2009-11-26 01:48:42.729602183 +0900 @@ -180,7 +180,7 @@ main(int argc, char *argv[]) dropgid = 1; break; case 'n': - nflag = 1; + nflag += 1; break; case 'f': case 'l': case 's': case 'u': case 'w': warnx("[-flsuw] no longer supported"); @@ -378,12 +378,12 @@ main(int argc, char *argv[]) lsin->sin_family = AF_INET; isaddr = 1; } - if (!nflag) { + if (nflag == 0) { /* Attempt to change an IP address into a name */ if (isaddr && realhostname_sa(fn, sizeof(fn), sa, sa->sa_len) == HOSTNAME_FOUND) p = fn; - } else if (!isaddr) { + } else if (!isaddr && nflag > 1) { /* * If a host has only one A/AAAA RR, change a * name into an IP address Sincerely, -- Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan ume@mahoroba.org ume@{,jp.}FreeBSD.org http://www.imasy.org/~ume/