Subject: Re: NIS uid and gid remapped to 0?
To: Martti Kuparinen <martti.kuparinen@iki.fi>
From: Greywolf <greywolf@starwolf.com>
List: current-users
Date: 08/23/2002 09:45:06
On Fri, 23 Aug 2002, Martti Kuparinen wrote:

# ROOT dhcp118:~> uname -r
# 1.6_RC1
#
# ROOT dhcp118:~> tail -1 /etc/master.passwd
# +:::::::::
#
# ROOT dhcp118:~> tail -1 /etc/passwd
# +:*:0:0:::
#
# According to passwd uid and gid is remapped to 0 for all NIS users...

Nope (see below)

# I think in real life this is not the case as passwd is just generated
# from master.passwd and not used by the getpwent routines.
#
# Still looks like we have a bug in pwd_mkdb. Or am I missing something?
#

The latter. :)  NIS historically has taken "0" in uid and gid fields to
mean, on a global map only (+::0:0:::) "don't do any uid/gid remapping".

Some implementations (*cough*Linux*cough*) have seen fit to interpret the
"0" literally and remap accordingly (this may have changed), but by and
large a remapping to "0" is ignored, probably due to the fact that the
passwd code treats (char *) NULL as a 0 (it has to map to _something_)
after proper error checking and all that.

At least this was the case the last time I actually looked at getpw*().

				--*greywolf;
--
NetBSD: The devil's advocate.