On Wed, May 22, 2002 at 04:27:12PM +0100, Jamie Heckford wrote: > Hi, > > I was wondering if anyone would be able to tell me what the limit is on a > UID? Ie what is the highest integer it can go up to..... > > I suppose as well some applications have different values.. or am I > completly wrong :)
The functions that deal with user ID's take a parameter of type uid_t. The uid_t type is defined in <sys/types.h> as u_int32_t. Hence, at least theoretically, FreeBSD supports uid's in the range 0 to 4G-1. However, if you decide to go above 64K-1, you may hit various limitations. NFS and NIS (YellowPages), for example, will not be too happy about uid's that big, IIRC. There might be other programs which assume 16-bit uid's, although I cannot think of any at the moment. After 64K-1, the next roadblock is 2G-1, a.k.a. INT_MAX. This will become a problem as soon as some program tries to store an uid_t value into a plain, signed int variable - the value will either turn negative, or be truncated to 2G-1, and much fun will ensue. It is not too common for a program to misuse an uid in this kind, but it is for a gid - there are many programs, including some in the FreeBSD base system, which use 'int' instead of 'gid_t', simply because it's defined that way in <gid.h>. The 'usual' user creation utilities try to keep the gid the same as the uid, so if you create a user with an uid > 2G-1, your gid experience might be.. mm.. interesting. So, to sum it all up - there are no problems, except where there are :) G'luck, Peter -- Peter Pentchev [EMAIL PROTECTED] [EMAIL PROTECTED] PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 If the meanings of 'true' and 'false' were switched, then this sentence wouldn't be false.
msg34559/pgp00000.pgp
Description: PGP signature