[comp.std.unix] UIDs and GIDs

mbrown@osf.org (Mark Brown) (06/28/90)

From: mbrown@osf.org (Mark Brown)

In 1003.1, "User ID" is defined as a positive integer (so is GID)...

Also, uid_t is defined as an arithmetic type (same for gid_t).

How does one handle (or can one handle) certain networking conventions that
use a "dummy" user ("nobody") and require a user id of -2 ?

Do these conflict as they seem, or am I missing something (always possible..)

-- 
Mark Brown   IBM AWD / OSF  |  "The tricky part is common usage."
The Good     mbrown@osf.org |
The Bad     uunet!osf!mbrown|       ---B.2.8.2, "POSIX Symbols",
The Ugly     (617) 621-8981 |                 POSIX 1003.1-1988

Volume-Number: Volume 20, Number 57

hedrick@cs.rutgers.edu (06/29/90)

From:  hedrick@cs.rutgers.edu

I think you take -2 with some degree of poetic license.  Obviously
if your system uses unsigned shorts, call it 0xfffe instead of -2.
The only problem I know is with some System V implementations that
completely disallow uid's with the sign bit on.

Volume-Number: Volume 20, Number 60

domo@tsa.co.uk (Dominic Dunlop) (06/29/90)

From:  Dominic Dunlop <domo@tsa.co.uk>

In article <743@longway.TIC.COM> Mark Brown (mbrown@osf.org) writes:
>In 1003.1, "User ID" is defined as a positive integer (so is GID)...
>
>Also, uid_t is defined as an arithmetic type (same for gid_t).
>
>How does one handle (or can one handle) certain networking conventions that
>use a "dummy" user ("nobody") and require a user id of -2 ?
>
>Do these conflict as they seem, or am I missing something (always possible..)

No, you're spotting something.  Yes, this is a known conflict between
``certain networking conventions'' and POSIX.1.  My guess is that it falls
to POSIX.8 (transparent file access) to unwind.  As POSIX.8 is now defining
two styles of remote file access -- full POSIX.1 semantics (namely better
than ``certain networking conventions''), and highly curtailed semantics
(considerably less than ``certain networking conventions''), one option at
its disposal is to let negative user id's fall down the crack (gulf?)
between the two styles.  An alternative is to weasel out of the conflict by
saying that accesses to remote files by unrecognised users map onto some
unique, unprivileged uid without actually admitting that the uid might be
negative.  Or that they map onto UID_MAX - 1 (except that POSIX.1 does not
have a UID_MAX because uid_t is allowed to be a magic cookie -- albeit a
magic cookie of arithmetic type).  (Incidentally, ISO's central secretariat
has, not ureasonably, asked us for a definition of ``magic cookie''.
Suggestions?)
-- 
Dominic Dunlop

Volume-Number: Volume 20, Number 62

guy@auspex.uucp (Guy Harris) (06/29/90)

From:  guy@auspex.uucp (Guy Harris)

>How does one handle (or can one handle) certain networking conventions that
>use a "dummy" user ("nobody") and require a user id of -2 ?

One uses, say, 65534 instead.  As of when I was last at Sun, that was what
was going to be done for SunOS 4.1, which would have unsigned user and
group IDs for SVID compliance (and BSD compatibility, for that
matter...).

Volume-Number: Volume 20, Number 81

seanf@sco.COM (Sean Fagan) (06/30/90)

From: seanf@sco.COM (Sean Fagan)

In article <743@longway.TIC.COM> mbrown@osf.org (Mark Brown) writes:
>In 1003.1, "User ID" is defined as a positive integer (so is GID)...
>Also, uid_t is defined as an arithmetic type (same for gid_t).
>How does one handle (or can one handle) certain networking conventions that
>use a "dummy" user ("nobody") and require a user id of -2 ?
>Do these conflict as they seem, or am I missing something (always possible..)

Certain networking conventions are broken.

uid_t and gid_t have usually (always?) been considered unsigned shorts.
Most architectures let them get away with it, barely.  It is not a good
idea, though.

---
-----------------+
Sean Eric Fagan  | "Just think, IBM and DEC in the same room, 
seanf@sco.COM    |      and we did it."
uunet!sco!seanf  |         -- Ken Thompson, quoted by Dennis Ritchie
(408) 458-1422   | Any opinions expressed are my own, not my employers'.

Volume-Number: Volume 20, Number 64

gwyn@smoke.brl.mil (Doug Gwyn) (06/30/90)

From: Doug Gwyn <gwyn@smoke.brl.mil>

In article <743@longway.TIC.COM> From: mbrown@osf.org (Mark Brown)
>How does one handle (or can one handle) certain networking conventions that
>use a "dummy" user ("nobody") and require a user id of -2 ?

These are not POSIX-conforming.
NFS was determined to not be POSIX-conformant in several ways
during 1003.1 deliberations.  Our consensus was that we shouldn't
mess up UNIX standards to accommodate such clear violations of
UNIX conventions as the use of negative UIDs.

It is possible that you can get away with using UID 65534 instead
of -2.

Volume-Number: Volume 20, Number 70

jfh@rpp386.cactus.org (John F. Haugh II) (06/30/90)

From:  jfh@rpp386.cactus.org (John F. Haugh II)

In article <743@longway.TIC.COM> From: mbrown@osf.org (Mark Brown)
>How does one handle (or can one handle) certain networking conventions that
>use a "dummy" user ("nobody") and require a user id of -2 ?

The solution in AIX 3.1 was to use whatever the value of (unsigned) -2
happens to be as an unsigned integer string.  It comes out to be some
real long ugly number ...
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh@rpp386.cactus.org

                                            Proud Pilot of RS/6000 Serial #1472

Volume-Number: Volume 20, Number 74