On 2000-Mar-13 12:01:03 +1100, Paul Richards <[EMAIL PROTECTED]> wrote:
>id = strtoul(p, (char **)NULL, 10);
>    if ((errno == ERANGE) || (id >= UID_MAX)) {
>        warnx("%s > max uid value (%lu)", p, UID_MAX);
>        return (0);
>}

You can do this now.  Just add the following:
        pid_t   UID_MAX = ~0;
somewhere before the code.

>When you see it written out like that the latter is a lot more
>informative. It also provides the flexibility to limit the parameters
>max value even if the type allows it to be larger. This is of particular
>significance to UIDs which are currently limited to a far smaller value
>than would fit in a uid_t.

AFAIK, there's no real hard limit.  adduser(8) limits uids to 32000
to prevent portability problems with systems using a signed 16-bit
uid_t (whilst allowing for a few `special' uids near the top of the
range).  Other potential limits are ~65000 (16-bit unsigned) and
99999 (5 decimal digits).

It would be nice if there was a system-wide constant that could be
used for this, but it's not obvious where this should be located.
(And note that adduser(8) is a perl script, so it can't use a C
header file without some contortions).

Peter


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to