Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Apr 1999 17:18:08 -0700
From:      Rahul Dhesi <dhesi@rahul.net>
To:        freebsd-current@freebsd.org
Subject:   showing full host names in output from who/finger/last
Message-ID:  <199904110018.AA21927@bolero-x.rahul.net>

next in thread | raw e-mail | index | archive | help
For some years I have been using patched utilities under SunOS to show
full host names in the output from the 'who', 'finger', and 'last'
commands.  (Traditional UNIXes truncate host names to about 16
characters.)

I have been thinking of patching FreeBSD programs to do the same, but
since I have been updating my source tree often, it will be a bit
painful to maintain my changes through the updates.  So I will do it
only if the FreeBSD developers would be willing to incorporate my
changes into the official FreeBSD source tree.  Below is what I would 
do -- tell me if it could be make a part of FreeBSD.

- Update all programs that write to utmp and wtmp to check the host name
  length, and if it's too long, insert the IP address instead
- Update all of the above programs, if they accept a host name on the
  command line, to also accept an additional argument that specifies
  the IP address.
- Update all programs that invoke the above programs and supply a
  host name to also supply the IP address.
- Update all programs that look up wtmp and utmp such that, if they find
  an IP address, they do a double-reverse DNS resolution (IP address ->
  fqdn -> IP address) and, if successful and consistent, display the
  host name instead of the IP address.  The user may if he wishes supply
  a command-line argument to suppress the reverse resolution and cause
  the IP address to be displayed directly.

For example, rlogind might invoke /usr/bin/login as:

   /usr/bin/login -h 98.portland-23-24rs.or.dial-access.att.net -i 12.73.137.98

/usr/bin/login notices that the host name is too long, inserts
12.73.137.98 into utmp and wtmp.  If no -i argument is available,
/usr/bin/login would do a forward DNS resolution of the host name to get
the IP address.

Below are samples from the 'last' and 'finger' commands with only the
really long host names included and some information x'd out to protect
user privacy.  (Obviously comumnar alignment doesn't work as well for
very long host names, but only a small fraction are that long.  The rest
will display normally in aligned columns.)

== output from 'finger ==
Login        Name               Idle       When         Where
xxxxxx   xxxxxxxxxxxxxx            7  Apr  9 13:14  kaibab.redbacknetworks.com
xxx      xxxxxxxxxxxxxxx              Apr 10 16:37  dyn164.rahul.net
xxxxxxxx xxxxxxxxxxxx              8  Apr 10 16:48  c166.ppp.tsoft.com
xxxxx    xxxxxxxxxxx                  Apr  9 23:35  \
                                                 cxxxxxxx-x.xxxxx.occa.home.com
xxxxx    xxxxxxxxxxxx         *   10  Apr 10 16:44  01-025.006.popsite.net

== output from 'last' ==
xxx       s1  98.portland-23-24rs.or.dial-access.att.net Sat Apr 10 16:50 - 16:50  (00:00)
xxxxxx    rd  oak-hiper1b-145-145.dialup.slip.net Sat Apr 10 16:48 - 16:51  (00:03)
xxxx      p6  netcom14.netcom.com            Sat Apr 10 15:36 - 15:39  (00:03)
xxxxx     s2  adsl-xxx-xxx-xxx-10.dsl.snfc21.pacbell.net Sat Apr 10 13:51 - 13:52  (00:00)
xxxxxxxx  sb  tnt9-xxx-xxx-17-189.dialup.HiWAAY.net Sat Apr 10 12:54 - 14:54  (02:00)
xxxxxx    s2  oak-hiper1a-15-79.dialup.slip.net Sat Apr 10 12:37 - 12:40  (00:02)
xxxx      r2  dnai-207-181-255-82.dialup.dnai.com Sat Apr 10 11:41 - 13:58  (02:17)
xxxxxxx   q8  sdn-ar-001casfraP195.dialsprint.net Sat Apr 10 08:28 - 13:30  (05:01)
== END ==


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




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