SUMMARY: UID upper limits

From: Christopher L. Davis <cld_at_spectre.prin.edu>
Date: Thu, 24 Aug 1995 09:10:58 -0500

My original message read as follows.

Hello. I was just trying to do some research on the possibility of assigning
        large UIDs. When I tried adduser, it complained that the UID was
> 60000. When I tried adding a user by hand, it didn't recognize the
        user (I tried 200000). The type for uid_t is a 4 byte unsigned int,
        which should handle the size UID I want to use (under 150000, but some
        over 60000).

        Anyone have any ideas? Is the 60000 limit artificially imposed to
        maintain compatability with other systems, or is there a real reason
        to limit UIDs to 60000?

---------------
My thanks to those who responded. I appreciate their information. I decided
not to try messing with large UIDs, as my Service provider and some of those
below noted that problems may arise, esp. with NFS to other machines that
impose the 2 byte limit strictly. I am enclosing the answers, as they were
short and each had some interesting info.

Here are the messages.
----------------------
From: Jorn Wilms <wilms_at_maxim.Colorado.EDU>
the max. for the gid is USHRT_MAX, which is defined in
/usr/sys/include/arch/alpha/machlimits.h
to be 65535. I'm not sure, but I think that's for compatibility with
other machines (same limit is set on SUN). I think the last 5000 uids
are reserved for system use.
----
From: alan_at_nabeth.cxo.dec.com (Alan Rollow - Dr. File System's Home for Wayward Inodes.)
	In /usr/include/limits.h you'll find UID_MAX defined as
	USHRT_MAX.  I think adduser redefines it own limit despite
	this one.  If I recall recorrectly, this is a bug that will
	be fixed in a future release.  The most likely reason for
	it being USHRT_MAX is compatibility with system still using
	shorts for the UID.
----
From: "Miguel Mena (Digital UNIX Support Switzerland)" <migi_at_zuo.dec.com>
see /usr/include/sys/limits.h:
#define UID_MAX   USHRT_MAX   /* max value for a user or group ID */
in /usr/include/machine/machlimits.h:
#define USHRT_MAX 65535U      /* max value for an unsigned short */
----
From: "Anthony D'Atri" <aad_at_nwnet.net>
Some OS's seem to only allow one to go up to 32k-1 or so, so that's the
safest bet.
----
From: Spider Boardman <spider_at_orb.nashua.nh.us>
UFS only supports 16 bits of UID on-disk.  There may be some
utilities which assume that a short or a ushort can hold a UID,
still, too.  ADVfs does support 32-bit UIDs on-disk, I'm told,
but I haven't tried to verify that.  The login program and its
library code do support 32-bit UIDs, though.  It looks like it
should be possible to have a user with a large UID, but that user
won't be able to own any files on UFS filesystems, or over NFS to
UFS filesystems.
----
From: "Danny J. Mitzel" <dmitzel_at_everest.hitc.com>
from passwd(4):
>>  The allowable values for the UID are unsigned numbers from 0 to 65535.
----
From: Mike Iglesias <iglesias_at_draco.acs.uci.edu>
I believe the 60000 limit is a Posix thing.  The actual limit for
Digital Unix is 65535.
-----------------------------
Thanks again everyone.
Chris
--
Christopher L. Davis       Systems and Network Administrator
The Principia                   PHONE:  (314)-434-2100
13201 Clayton Road                FAX:  (314)-275-3538
St. Louis, MO  63131         INTERNET:  cld_at_prin.edu
Received on Thu Aug 24 1995 - 16:35:04 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT