Date: Sat, 24 Jan 1998 19:20:01 -0800 (PST) From: Alex Bulan <avb@korax.net> To: freebsd-bugs Subject: Re: bin/4497: Reverse DNS fails for some CIDR *.IN-ADDR.ARPA domains Message-ID: <199801250320.TAA07261@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/4497; it has been noted by GNATS. From: Alex Bulan <avb@korax.net> 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 <avb@korax.net> +1 416 979 2112 Systems Administrator, Korax Online Inc. http://www.korax.net/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801250320.TAA07261>