Subject: Re: negative user-ids and interoperability.
To: Simon Burge <simonb@netbsd.org>
From: Giles Lean <giles@nemeton.com.au>
List: tech-userlevel
Date: 04/26/1999 21:14:11
On Mon, 26 Apr 1999 14:40:30 +1000  Simon Burge wrote:

> Ideas anyone?  What do the standards have to say about uid ranges?

Again, from UNIX 98 (a pretty dodgy standard to want to adhere to, but
what I've easiest access to):

 user ID

    A non-negative integer that is used to identify a system
    user. When the identity of a user is associated with a process, a
    user ID value is referred to as a real user ID, an effective user
    ID or a saved set-user-ID.

Now, that's a fine mess, given that "everyone" has always used
negative user ids for root over NFS, nobody etc etc.

For example, from the HP-UX passwd(4) manual page:

    The user ID is an integer value between -2 and UID_MAX inclusive.

Then from limits(5)

    UID_MAX    Smallest			      2147483647 +
               unattainable
               value for a user
               or group ID

Now, that looks awfully like a signed 32 bit quantity to me, 2^32-1.

Then I think I recall that some of the archive formats (cpio?) have
restrictions on user ids.  The HP-UX manual page claims that user ids
greater than 60K are restored as the current user id because of this.
The UNIX 98 cpio(1) manual page doesn't mention user ids.

While I've never seen a document describing the cpio archive format
just about everything in cpio is a 16 bit quantity, so I assume that
"60K" here is 2^16-1.  Of course, cpio is pretty much dead and
deprecated in UNIX 98.

What a mess.  Maybe "nobody" in /etc/passwd isn't such a bad idea.
Making user ID "non-negative" looks like an error on the part of the
standards folk.  Of course, they don't make errors, they just make the
whole world non-conformant.

I need a (strong) drink!

Regards,

Giles