[4495] in Athena Bugs

home help back first fref pref prev next nref lref last post

comp.bugs.4bsd: rlogind/BIND interaction

daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Sun Mar 11 21:35:37 1990

Date: Sun, 11 Mar 90 21:35:25 -0500
From: Jonathan I. Kamens <jik@pit-manager.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
In article <48750@wlbr.IMSD.CONTEL.COM>, sms@wlv.imsd.contel.com (Steven
M. Schultz) writes:
> Subject: rlogind/BIND undesireable interaction (+FIX)
> Index:	etc/rlogind/rlogind.c 4.3BSD
> 
> Description:
> 
> 	The version of 'rlogind' is 5.22.1.7 dated 9/11/89, and the problem 
> 	is in the "verification" process 'rlogind' performs to make sure
> 	the remote host is really himself.
> 
> 	'Rlogind' does a gethostbyaddr() to look up the name of the
> 	client host, receives a successfull response, and then
> 	performs a gethostbyname() using the name returned earlier.
> 
> 	Unfortunately, there is not a trailing '.' at the end of
> 	the name returned by gethostbyaddr() and RES_DNSRCH (and RES_DEFNAME)
> 	are ON (by default), so the resolving routines merrily start appending 
> 	the various domain subcomponents and issuing queries to the 'named'.
> 	In turn, 'named' can end up wandering out to the root servers before
> 	the domain search path is empty and a query on the ORIGINAL
> 	name is done (query ends up back in the local domain finally), at
> 	which point the 'rlogin' completes.  Very slow!  Especially if
> 	any network links/interfaces are down.
> 
> Repeat-By:
> 	Probably the easiest way to see this is to turn on the debugging
> 	in the name servor with a SIGUSR1 and watch /usr/tmp/named.run.
> 
> 	Alternatively, use 'nslookup' with RES_DEBUG turned on.
> 
> Fix:
> 	Apply this patch to rlogind and reinstall rlogind.
> 
> *** rlogind.c.old	Fri Oct  6 17:29:38 1989
> --- rlogind.c	Thu Mar  8 10:21:14 1990
> ***************
> *** 57,62 ****
> --- 57,64 ----
>   #include <netdb.h>
>   #include <syslog.h>
>   #include <strings.h>
> + #include <arpa/nameser.h>
> + #include <resolv.h>
>   
>   #ifndef TIOCPKT_WINDOW
>   #define TIOCPKT_WINDOW 0x80
> ***************
> *** 170,175 ****
> --- 172,185 ----
>   		 */
>   		strncpy(remotehost, hp->h_name, sizeof(remotehost) - 1);
>   		remotehost[sizeof(remotehost) - 1] = 0;
> + #ifdef	RES_DNSRCH
> + 		/*
> + 		 * gethostbyaddr returns a FQDN, so now the domain search
> + 		 * action must be turned off to avoid unwanted queries to
> + 		 * the nameservor.
> + 		*/
> + 		_res.options &= ~RES_DNSRCH;
> + #endif	RES_DNSRCH
>   		hp = gethostbyname(remotehost);
>   		if (hp)
>   #ifdef h_addr	/* 4.2 hack */

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710

home help back first fref pref prev next nref lref last post