Help diagnosing NIS breakage ?

TOMITA Yoshinori yoshint at
Wed Jul 16 20:17:46 PDT 2003

Hi Bill, I have a question.

>> On Tue, 15 Jul 2003 10:44:15 -0700 (PDT), wpaul at (Bill
>> Paul) said:

B> I uploaded a new diff, please test this instead:


B> Thanks for providing me access to this machine, it helped me realize
B> where I'd gone wrong in my patch. If this works for you, and if nobody
B> objects, I will check it in.

Is your patch "getpwent.diff" really for revision 1.82 ?
If so, nis_map() will be like this and I do not think this works.

------ ------ ------ ------ ------ 
static int
nis_map(char *domain, enum nss_lookup_type how, char *buffer, size_t bufsize,
    int *master)
	int	rv;
	char	*outname;

	*master = 0;
	if (geteuid() == 0) {
		if (snprintf(buffer, bufsize, "",
		    (how == nss_lt_id) ? "uid" : "name") >= bufsize)
			return (NS_UNAVAIL);
		rv = yp_order(domain, buffer, &outname);
		if (rv == 0)
			*master = 1;
		return (NS_UNAVAIL);

	return (NS_SUCCESS);
------ ------ ------ ------ ------ 

In case of geteuid()==0, always NS_UNAVAIL returned
In case of geteuid()!=0, map name is not assigned to *buffer

I did not imagine my idea of yp_order() would break NIS with
ActiveDirectory, which I have never seen so far.

TOMITA Yoshinori

More information about the freebsd-current mailing list