Subject: UID_MAX (Was: alarm(4G)?)
To: Paul Wain <paul.wain@nc.com>
From: Geoff Wing <gcw@pobox.com>
List: current-users
Date: 01/07/1999 18:49:47
Paul Wain wrote about Re: alarm(4G)?:
:This one makes some sense when you think about it in terms of say NFS et al...
:uid=-1, gid=-1 => nobody/unknown on NFS/PCNFS
:uid=-2, gid=-2 => bad root access over NFS/PCNFS - see exports(5)
:Thus, the max valid value for uid/gid is (signed int) -3, or 2^31-2 (-1 is 2^32,
:-2 is 2^31-1) assuming that uid and gid are 32 bit ints (try teaching that to
:e.g. a SunOS 4.x machine that just mounted you - it uses 16 bit ints but thats
:another matter entirely :)
:Geoff Wing wrote:
:> 4) Another interesting thing: <sys/syslimits.h>
:> #define GID_MAX            2147483647U  /* max value for a gid_t (2^31-2) */
:> #define UID_MAX            2147483647U  /* max value for a uid_t (2^31-2) */
:>                                                                       ^^
:>                                                                       yeah?

Yes, but 2^31-2 != 2147483647U esp. since one's an odd number and the other's
an even number, so either the number is wrong or the comment.
-- 
Geoff Wing   <gcw@pobox.com>            Mobile : 0412 162 441
Work URL: http://www.primenet.com.au/   Ego URL: http://pobox.com/~gcw/