Subject: Re: bin/18222: patch to allow a uid or gid of (-2) matching default NFS mapping for remote root users
To: None <netbsd-bugs@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: netbsd-bugs
Date: 09/07/2002 19:44:09
On Sat, Sep 07, 2002 at 07:23:10PM +0100, David Laight wrote:
> > >Synopsis: patch to allow a uid or gid of (-2) matching default
> > NFS mapping for remote root users
> >
> > increase UID_MAX and GID_MAX to (UINT_MAX-1)
>
> Wouldn't it be better to use (~(uid_t)0 - 1) and (~(gid_t)0 - 1) ?
A quick look at the history of syslimits.h (brought on by the fact
that the comments for these values didn't match the value) shows
that the limit has been 2^32-2 before.
It was changed because setreu/gid() allows -1 (meaning don't
change) which has to be within the domain of u/gid_t.
This is another of those types [1] whose domain is -1..MAXINT-1
that C doesn't quite copy with.
David
[1] includes pid_t and the return value from lseek(), probably
really size_t in genaral.
--
David Laight: david@l8s.co.uk