Operating System - HP-UX
1753521 Members
5202 Online
108795 Solutions
New Discussion юеВ

Re: Whats the Max size of UID

 
SOLVED
Go to solution
Tony Scully_3
Advisor

Whats the Max size of UID

Bit confused - man 4 passwd refers to UID_MAX but I cannot find a reference to this anywhere in /usr/include/ - does anyone know the default and maximum (if configurable) possible value.

Cheers,

Tony.
8 REPLIES 8
Patrick Wallek
Honored Contributor
Solution

Re: Whats the Max size of UID

According to 'man useradd' the max UID is defined in (I look in /usr/include/sys/param.h) and MAXUID equals MAXINT which is 0x7FFFFFFF, which corresponds to 2147483647.

Now that is assuming I am reading everything correctly. :)
Jeff_Traigle
Honored Contributor

Re: Whats the Max size of UID

From the limit(5) man page.

EXAMPLES
UID_MAX has an HP-UX value of 2147483647 + , which means that on all
HP-UX systems the smallest unattainable value for a user or group ID
is at least 2147483647. A particular system might be capable of
supporting more than 2147483647 user or group IDs, in which case its
file sets UID_MAX to a higher value; however, any
application assuming such a higher value is not guaranteed to be
portable to all HP-UX systems.
--
Jeff Traigle
Sanjay_6
Honored Contributor

Re: Whats the Max size of UID

Hi tony,

Take a look at this link from docs.hp.com,

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/5990-8172/5990-8172_top.html&con=/hpux/onlinedocs/5990-8172/00/00/66-con.html&toc=/hpux/onlinedocs/5990-8172/00/00/66-toc.html&searchterms=uid&queryid=20041015-080626

Take a look at the section "The /etc/passwd File"

/quote/

User ID (uid), an integer ranging from 0 to MAXINT-1 (equal to 2,147,483,646).

/EndQuote/

Hope this helps.

Regds
Tony Scully_3
Advisor

Re: Whats the Max size of UID

Guys,

Thanks, after posting I did find the param.h file (my find/grep took a bit of time!).

Thanks for the replies, very quick as usual.

Points allocation seesm to be broken at the moment, but as soon as I can I will allocate.

Cheers,

Tony
Bill Hassell
Honored Contributor

Re: Whats the Max size of UID

Note also that large UID's is a recent feature in HP-UX. The old limit was 60000 and changed at 10.20 to allow 32bit UIDs (2 billion). This was fairly invasive (not just the passwd file but inodes on filesystems, etc) so the parameter files had to have an old and new behavior (see /usr/include/sys/inode.h).


Bill Hassell, sysadmin
A. Clay Stephenson
Acclaimed Contributor

Re: Whats the Max size of UID

The other reason to stay below the old 60000 UID limit is for NFS compatibility. Unless you have a compelling reason to use UID's > 60000, I would stay with the lower values because you could very well break legacy systems or fight problems when using NFS to transfer to non-HP-UX boxes. For example, uid -2 (illegal but the two's complement of 0xFFFF -- 64K - 1) was used as the anonymous NFS uid.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Whats the Max size of UID

Oops, that should be 0xFFFE for -2; 0xFFFF is the two's-complement of -1. My advanced hunt-and-peck typing technique got me again.

If it ain't broke, I can fix that.
Tony Scully_3
Advisor

Re: Whats the Max size of UID

Thanks for the additional information - there is an 'interoperabilty' warning in the man page for passwd (section 4 of the manual)about using UIDs above 60000, but it does not go into detail - we had assumed it was either NFS or OS version related, thanks to you guys that's now cleared up.

Fortunately, the question is now moot, we will not have to use UIDs greater than 60000. The issue had arisen because the system architects here were looking to use a Peoplesoft reference or Employee number as either part of the username (not nice) or as the UID. Sense has prevailed though, and we now plan to include that number in part of the GECOS info field. Finger and chfn will be disabled.

Username will be a 'human' name and UIDs will be in a specifc range dependent on department. We don't have anything like 60000 UX users.

Thanks again for the replies.

Tony.