*BSD News Article 7411


Return to BSD News archive

Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!agate!ames!sun-barr!cs.utexas.edu!uunet!ogicse!psgrain!hippo!shrike.und.ac.za!casper.cs.uct.ac.za!gimli!root
From: root@gimli.cs.uct.ac.za (Sandi Donno)
Newsgroups: comp.unix.bsd
Subject: [386BSD] bug in rlogind? - fix
Message-ID: <sandi.720870024@gimli>
Date: 4 Nov 92 09:40:24 GMT
Article-I.D.: gimli.sandi.720870024
Sender: news@casper.cs.uct.ac.za (news)
Organization: Computer Science Department, University of Cape Town
Lines: 31

I am porting an application to 386bsd that requires one to be able
to rlogin from the master machine back to itself as root (It is a replacement 
for yellow pages, that distributes passwd and other information using root 
host equivalence. The mechanism for distribution is the same for all machines, 
even the current machine, and I certainly don't want to rewrite it).

Anyway, I discovered that rlogin back to the same machine as root didn't work
under 386bsd, i.e. root's .rhosts  file is ignored (rshd works, but not
rlogind). I traced it to the following code in rlogind.c:

do_rlogin(host)
	char *host;
{
......
	if (pwd->pw_uid == 0)
		return(-1);
	return(ruserok(host, 0, rusername, lusername));
}

I replaced the return(-1) with:
		return(ruserok(host, 1, rusername, lusername));
(the 1 as the second parameter says that this is a superuser check)
and now rlogind works as I expect it to.

Is there any reason for the return(-1) that anyone can think of, or is
it a bug?
--
Sandi Donno
Computer Science Dept.
University of Cape Town
South Africa