From owner-freebsd-questions Wed Jun 2 13:29: 4 1999 Delivered-To: freebsd-questions@freebsd.org Received: from awfulhak.org (awfulhak.force9.co.uk [195.166.136.63]) by hub.freebsd.org (Postfix) with ESMTP id 7307314E0B for ; Wed, 2 Jun 1999 13:28:55 -0700 (PDT) (envelope-from brian@lan.awfulhak.org) Received: from keep.lan.Awfulhak.org (keep.lan.Awfulhak.org [172.16.0.8]) by awfulhak.org (8.9.3/8.9.2) with ESMTP id VAA01813; Wed, 2 Jun 1999 21:27:52 +0100 (BST) (envelope-from brian@lan.awfulhak.org) Received: from keep.lan.Awfulhak.org (localhost [127.0.0.1]) by keep.lan.Awfulhak.org (8.9.3/8.9.3) with ESMTP id TAA00635; Wed, 2 Jun 1999 19:06:51 +0100 (BST) (envelope-from brian@keep.lan.Awfulhak.org) Message-Id: <199906021806.TAA00635@keep.lan.Awfulhak.org> X-Mailer: exmh version 2.0.2 2/24/98 To: Joseph Davida Cc: questions@freebsd.org Subject: Re: command who (and w) In-reply-to: Your message of "Wed, 02 Jun 1999 10:40:15 CDT." <199906021540.KAA04706@davida.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 02 Jun 1999 19:06:51 +0100 From: Brian Somers Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 .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 Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message