SUMMARY: Selective NIS group support broken in 4.1.2? [in a way]

From: Jim Mattson (mattson@cs.UCSD.EDU)
Date: Thu Sep 10 1992 - 21:51:10 CDT

First, thanks to all who replied:

"John D. Barlow" <> (Jacques Beigbeder)
Casper Dik <>
Christian Lawrence <>

John Barlow would have had the right answer, except that he didn't know
about a minor bug in getgrent.c. He said:

> in /etc/group on the gateway hosts:
> network:::root
> -network
> +:

Basically, if you don't use a negative entry to preclude inclusion of
the network group from NIS, the NIS network group will essentially
override the local network group when the '+' (all groups) line is

What John didn't know is that the code is busted, and when verifying
the syntax of the group entry, it doesn't understand that a group name
beginning with '-' is an NIS entry. Hence, it _requires_ a numeric
gid field. If you don't have one, the line is considered malformed,
and the rest of the file is ignored. (How clever. :-)

So, a working solution is:


Note that I've also added a '+' to the local network group so that I
can leave the gid out. The following also works:


Here's the patch to getgrent.c (Solaris 1.01 sources), for anyone who cares:

< ypentry = (*p == '+');

>       ypentry = (*p == '+' || *p == '-');


This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:49 CDT