Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 02 Jun 1999 19:06:51 +0100
From:      Brian Somers <brian@Awfulhak.org>
To:        Joseph Davida <jd@davida.com>
Cc:        questions@freebsd.org
Subject:   Re: command who (and w) 
Message-ID:  <199906021806.TAA00635@keep.lan.Awfulhak.org>
In-Reply-To: Your message of "Wed, 02 Jun 1999 10:40:15 CDT." <199906021540.KAA04706@davida.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
The ``who'' program simply displays the UT_HOSTSIZE bytes stored in 
utmp.  If this is a truncated machine name, then the program that 
logged you in is the culprit.

All the standard daemons in libexec should do this properly using the 
realhostname() and trimdomain() functions from libutil and sshd 
should also do things properly if you've rebuilt it recently.

> 	In releases 2.x, who and w would show the fully qualified
> 	hostname of all users who login from a remote host.
> 	If the fully qualified name is too long for display, then
> 	the IP address would get printed. For example on 2.2.1:
> 
> user1	ttyp1	Jun  2 07:29   (relay.mfa.com)
> user2	ttyp2	Jun  2 08:06   (204.154.227.254)
> 
> 	In 3.2, 'who' no longer prints the IP address if the
> 	fully qualified hostname is too long. It just truncates the
> 	name. For example:
> 
> roger            ttyp3   Jun  2 10:00	(xxxxxx.xxxxxxx)
> 
> 	(Name of remote host replaced char for char with an x to
> 	 keep the confidentiality of the user's host name.
> 	 Roger is also a fictitious user name).
> 
> 	As you can see, it truncated the .com from the hostname.
> 	Other commands suffer the same behavior:
> 	last, finger.
> 
> 	The odd behavior is that if the hostname is really long,
> 	such as <some_slip_connection>.worldnet.att.net,
> 	then in 3.2, 'who' does resort to printing the IP address.
> 
> 	Many user shell scripts which relied on getting either the
> 	IP address or the fully qualified hostname from the who
> 	command will no longer work if the hostname falls within
> 	certain (unknown) length ranges. Machine I am on does not
> 	keep sources online, so I will have to lookup the who source
> 	code on another machine.

-- 
Brian <brian@Awfulhak.org>                        <brian@FreeBSD.org>
      <http://www.Awfulhak.org>;                   <brian@OpenBSD.org>
Don't _EVER_ lose your sense of humour !          <brian@uk.FreeBSD.org>




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906021806.TAA00635>