Date: Wed, 22 May 2002 19:21:14 +0300 From: Peter Pentchev <roam@ringlet.net> To: Jamie Heckford <jamie@tridentmicrosystems.co.uk> Cc: freebsd-hackers@freebsd.org Subject: Re: UID Limit Message-ID: <20020522192114.M349@straylight.oblivion.bg> In-Reply-To: <001901c201a5$25b8e0e0$4464a8c0@JAMIEHECKFORD>; from jamie@tridentmicrosystems.co.uk on Wed, May 22, 2002 at 04:27:12PM %2B0100 References: <001901c201a5$25b8e0e0$4464a8c0@JAMIEHECKFORD>
next in thread | previous in thread | raw e-mail | index | archive | help
--gTY1JhLGodeuSBqf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 22, 2002 at 04:27:12PM +0100, Jamie Heckford wrote: > Hi, >=20 > 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..... >=20 > 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 --=20 Peter Pentchev roam@ringlet.net roam@FreeBSD.org 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 wou= ldn't be false. --gTY1JhLGodeuSBqf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE868V67Ri2jRYZRVMRAu2sAKCF5yOCPYUy15l5zBkPWb3CHcdNbwCgisCI 9my/OZfg2y2GBf7L2J8aPpg= =SGpc -----END PGP SIGNATURE----- --gTY1JhLGodeuSBqf-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020522192114.M349>