From owner-freebsd-bugs Sat Jan 24 19:20:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA07279 for freebsd-bugs-outgoing; Sat, 24 Jan 1998 19:20:04 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA07261; Sat, 24 Jan 1998 19:20:01 -0800 (PST) (envelope-from gnats) Date: Sat, 24 Jan 1998 19:20:01 -0800 (PST) Message-Id: <199801250320.TAA07261@hub.freebsd.org> To: freebsd-bugs Cc: From: Alex Bulan Subject: Re: bin/4497: Reverse DNS fails for some CIDR *.IN-ADDR.ARPA domains Reply-To: Alex Bulan Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/4497; it has been noted by GNATS. From: Alex Bulan To: freebsd-gnats-submit@freebsd.org, csg@wintek.com Cc: Subject: Re: bin/4497: Reverse DNS fails for some CIDR *.IN-ADDR.ARPA domains Date: Sat, 24 Jan 1998 22:19:14 -0500 (EST) This doesn't appear to be a resolution problem, but rather a workaround for the 16-character hostname field size limit in utmp, wtmp and lastlog. /usr/bin/login records the user's IP address, rather than the hostname, if the hostname is longer than 16 characters. It was probably added as a feature around 2.2.2, as I don't seem to remember this happening before, but personally, I prefer to have the first 16 characters of the hostname in there rather than the IP. I was able to change this behaviour by commenting out the relevant `if' clause in /usr/bin/login: *** login.c.orig Sun Oct 19 06:39:41 1997 --- login.c Sat Jan 24 14:48:22 1998 *************** *** 210,216 **** if (domain && (p = strchr(optarg, '.')) && strcasecmp(p, domain) == 0) *p = 0; ! if (strlen(optarg) > UT_HOSTSIZE) { struct hostent *hp = gethostbyname(optarg); if (hp != NULL) { --- 210,216 ---- if (domain && (p = strchr(optarg, '.')) && strcasecmp(p, domain) == 0) *p = 0; ! /* if (strlen(optarg) > UT_HOSTSIZE) { struct hostent *hp = gethostbyname(optarg); if (hp != NULL) { *************** *** 221,227 **** } else optarg = "invalid hostname"; } ! hostname = optarg; break; case 'p': pflag = 1; --- 221,227 ---- } else optarg = "invalid hostname"; } ! */ hostname = optarg; break; case 'p': pflag = 1; The better solution would be to make this an optional feature via a command-line flag. I also had to edit /usr/local/libexec/ftpd (wu-ftpd), and /usr/local/sbin/sshd, as they do the same thing. I'm not sure about the stock ftpd server as I don't use it. rlogind/rshd should be fine as I believe they use /bin/login. This kind of begs the question, though, why is the hostname field size only 16 characters? Are there plans to increase it in a future release? -- Alex Bulan +1 416 979 2112 Systems Administrator, Korax Online Inc. http://www.korax.net/