From nobody@FreeBSD.org  Tue Jan 11 09:17:54 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3133816A4CF
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 11 Jan 2005 09:17:54 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id EC90843D39
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 11 Jan 2005 09:17:53 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j0B9Hr8e085313
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 11 Jan 2005 09:17:53 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j0B9Hr5t085312;
	Tue, 11 Jan 2005 09:17:53 GMT
	(envelope-from nobody)
Message-Id: <200501110917.j0B9Hr5t085312@www.freebsd.org>
Date: Tue, 11 Jan 2005 09:17:53 GMT
From: Jesper Wallin <jesper@hackunite.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: The "-n" option in /usr/bin/w is broken
X-Send-Pr-Version: www-2.3

>Number:         76089
>Category:       bin
>Synopsis:       w(1) The "-n" option in /usr/bin/w is broken
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 11 09:20:22 GMT 2005
>Closed-Date:    Tue Jun 24 12:08:10 UTC 2008
>Last-Modified:  Tue Jun 24 12:08:10 UTC 2008
>Originator:     Jesper Wallin
>Release:        FreeBSD 5.3-RELEASE-p2
>Organization:
>Environment:
FreeBSD ninja.hackunite.net 5.3-RELEASE-p2 FreeBSD 5.3-RELEASE-p2 #5: Tue Dec 14 20:55:01 CET 2004     root@ninja.hackunite.net:/usr/obj/usr/src/sys/ninja  i386
>Description:
The "-n" (do not resolve hosts) in /usr/bin/w seems to be broken in 5.3 ..  works fine in 5.2.1 and 4.10
>How-To-Repeat:
w -n
>Fix:
      
>Release-Note:
>Audit-Trail:

From: Edwin Groothuis <edwin@mavetju.org>
To: Jesper Wallin <jesper@hackunite.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/76089: The "-n" option in /usr/bin/w is broken
Date: Tue, 11 Jan 2005 21:40:13 +1100

 > The "-n" (do not resolve hosts) in /usr/bin/w seems to be broken in 5.3 ..  works fine in 5.2.1 and 4.10
 
 I think it has to do with the way it's logged in utmp:
 
 [/usr/src/usr.bin/w] edwin@k7>uname -a
 FreeBSD k7.mavetju 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #8: Wed Dec 15 16:58:01 EST 2004     edwin@k7.mavetju:/usr/src-5.2.1/sys/i386/compile/k7  i386
 [/usr/src/usr.bin/w] edwin@k7>last -20
 edwin            ttypp    203.220.9.178    Tue Jan 11 21:32   still logged in
 edwin            ttypt    203.220.9.178    Mon Jan 10 14:27 - 15:07  (00:40)
 edwin            ttyps    203.220.9.178    Mon Jan 10 14:14 - 14:54  (00:39)
 
 [/usr/src/usr.bin/w] root@mag>uname -a
 FreeBSD mag.barnet.com.au 5.3-RELEASE FreeBSD 5.3-RELEASE #2: Mon Dec 13 13:18:03 EST 2004     root@mag.barnet.com.au:/usr/src/sys/i386/compile/mag  i386
 root             ttyp0    edwin-3.int      Tue Jan 11 21:30   still logged in
 root             ttyp0    tim.direct.int   Tue Jan 11 09:49 - 09:49  (00:00)
 
 Edwin
 
 -- 
 Edwin Groothuis      |            Personal website: http://www.mavetju.org
 edwin@mavetju.org    |          Weblog: http://weblog.barnet.com.au/edwin/

From: Sergey Matveychuk <sem@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org, jesper@hackunite.net,
	hackers@FreeBSD.org
Cc:  
Subject: Re: bin/76089: The "-n" option in /usr/bin/w is broken
Date: Sun, 13 Feb 2005 19:50:44 +0300

 w(1) behaviour has changed with brien commit in w.c revision 1.48.
 
 Funny, but looks like '-n' options works right after commit, not before.
 
 The reason is utmp holds a host name and w(1) with '-n' flag _do_ 
 resolve hostname back in IP address and without '-n' don't resolve it.
 It's confised.
 
 IMHO to be more robust, we should make utmp to hold an IP address 
 instead of a hostname and change all applications that use it. As bonus 
 it will fix a delay on login when resolving does not work. And last(1) 
 will show more useful IP address instead of changable hostname.
 
 But I'm not sure about standards.
 
 -- 
 Sem.

From: Peter Jeremy <PeterJeremy@optushome.com.au>
To: Sergey Matveychuk <sem@freebsd.org>
Cc: freebsd-gnats-submit@freebsd.org, jesper@hackunite.net,
	hackers@freebsd.org
Subject: Re: bin/76089: The "-n" option in /usr/bin/w is broken
Date: Mon, 14 Feb 2005 17:16:23 +1100

 On Sun, 2005-Feb-13 19:50:44 +0300, Sergey Matveychuk wrote:
 >IMHO to be more robust, we should make utmp to hold an IP address 
 >instead of a hostname and change all applications that use it. As bonus 
 >it will fix a delay on login when resolving does not work. And last(1) 
 >will show more useful IP address instead of changable hostname.
 
 Depending on the environment, the IP address may be more changeable
 than the hostname.  Definitely, in a DHCP or dialup environment, you
 can't rely on the IP address at any time other than during the
 session.  There is little (if any) benefit in logging the IP address
 instead of the hostname.
 
 -- 
 Peter Jeremy

From: Sergey Matveychuk <sem@FreeBSD.org>
To: Peter Jeremy <PeterJeremy@optushome.com.au>
Cc: freebsd-gnats-submit@freebsd.org, jesper@hackunite.net,
	hackers@freebsd.org
Subject: Re: bin/76089: The "-n" option in /usr/bin/w is broken
Date: Mon, 14 Feb 2005 09:45:44 +0300

 Peter Jeremy wrote:
 
 > Depending on the environment, the IP address may be more changeable
 > than the hostname.  Definitely, in a DHCP or dialup environment, you
 > can't rely on the IP address at any time other than during the
 > session.  There is little (if any) benefit in logging the IP address
 > instead of the hostname.
 
 I agree, environments are different. So may be it makes no sense to 
 change hostname with IP. It was just an idea.
 
 But fact is, we lost 'w -n' semantic. And it should be fixed.
 BTW, UT_HOSTSIZE=16 is too short in my opinion.
 
 -- 
 Sem.

From: Sergey Matveychuk <sem@FreeBSD.org>
To: Sergey Matveychuk <sem@FreeBSD.org>
Cc: Peter Jeremy <PeterJeremy@optushome.com.au>,
	freebsd-gnats-submit@freebsd.org, jesper@hackunite.net,
	hackers@freebsd.org
Subject: Re: bin/76089: The "-n" option in /usr/bin/w is broken
Date: Mon, 14 Feb 2005 11:21:37 +0300

 Sergey Matveychuk wrote:
 
 > BTW, UT_HOSTSIZE=16 is too short in my opinion.
 
 As I can see, linux has UT_HOSTSIZE=256.
 
 -- 
 Sem.

From: Matteo Riondato <rionda@gufi.org>
To: bug-followup@FreeBSD.org, jesper@hackunite.net
Cc:  
Subject: Re: bin/76089: The "-n" option in /usr/bin/w is broken
Date: Sat, 11 Jun 2005 08:46:14 +0200

 The recording of the "realhostname" is a feature and not a bug.
 Both openssh and telnet call realhostname_sa() to convert the IP
 address of the remote peer to a realhostname.
 See line 661 of /usr/src/crypto/openssh/loginrec.c and line 688 of
 /usr/src/contrib/telnet/telnetd/telnetd.c .
 What should be done then? The "-n" option could be retired since no 
 longer supported or the man page should be changed to reflect the fact
 that this option is not supported by default (for openssh, one can
 change /usr/src/crypto/openssh/config.h to have addresses recorded in
 utmp. See line 180 and below.)
 
 IMHO the "-n" option can be retired since having a "realhostname" is
 probably better in terms of human readability and usefulness.
 
 Anyway, UT_HOSTSIZE is surely too small (16 is not enough..64 may be a
 better value).
 Best Regards
 -- 
 Rionda aka Matteo Riondato
 Disinformato per default
 G.U.F.I. Staff Member (http://www.gufi.org)
 FreeSBIE Developer (http://www.freesbie.org)
State-Changed-From-To: open->closed 
State-Changed-By: gavin 
State-Changed-When: Tue Jun 24 12:07:54 UTC 2008 
State-Changed-Why:  
Close, duplicate of bin/57089 

http://www.freebsd.org/cgi/query-pr.cgi?pr=76089 
>Unformatted:
