[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#295680: libc6: getgrname returns a result that doesn't belong to /etc/group



On 2005-06-17 02:03:08 +0300, Lars Wirzenius wrote:
> Thus, I think the Linux manual page saying that getgrnam uses
> /etc/group only is a bug.

So, that would also make programs that rely on /etc/group being used
buggy. IIRC, when I want to add a local group with addgroup, it checks
first if it exists with getgrnam, and refuses to create it if it can
be found. And this is an error if the group exists on NIS, but not
locally in /etc/groups.

Also, I wonder if the following is the correct behavior (grname is a
program that calls getgrgid or getgrnam depending on the argument):

$ ./grname doctex
42 (doctex)
$ ./grname 42
42 (shadow)

In the NIS database, group 42 is "doctex", but locally, it is "shadow".
My /etc/nsswitch.conf contains in particular:

group:          compat nis

IMHO, since /etc/group has the priority and group 42 exists here, then
the group "doctex" shouldn't have been visible.

Note that AFAIK, these mismatches are not avoidable when one wants to
use a Debian machine in a NIS network and when the administrators of
the machine and the network are not the same.

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA



Reply to: