Operating System - HP-UX
1845550 Members
2831 Online
110245 Solutions
New Discussion

How to find the maximum uid that can be assgined?

 
SOLVED
Go to solution
Crystal_1
Frequent Advisor

How to find the maximum uid that can be assgined?

Hi,

Does any one how to find the maximum uid that can be assigned to a new user?

Tx, Crystal
12 REPLIES 12
Rodney Hills
Honored Contributor

Re: How to find the maximum uid that can be assgined?

It use to be 65535 (2^16-1)

Don't know if it has changed.

-- Rod Hills
There be dragons...
Steven Mertens
Trusted Contributor

Re: How to find the maximum uid that can be assgined?

hi,

I'm not sure, but is it possible its
defined by UID_MAX ?


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.

regards

Steven
harry d brown jr
Honored Contributor

Re: How to find the maximum uid that can be assgined?

Which OS?

And even with a 64bit OS, some applications might not like large UID's, of which informix comes to mind with their older versions.

live free or die
harry
Live Free or Die
Steven Mertens
Trusted Contributor
Solution

Re: How to find the maximum uid that can be assgined?

see also :

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90682/B2355-90682_top.html&con=/hpux/onlinedocs/B2355-90682/00/03/314-con.html&toc=/hpux/onlinedocs/B2355-90682/00/03/314-toc.html&searchterms=UID_MAX&queryid=20020719-113712

The following fields have numerical limitations as noted:
The user ID is an integer value between -2 and
UID_MAX
inclusive.

The group ID is an integer value between 0 and
UID_MAX
inclusive.

Steven
S.K. Chan
Honored Contributor

Re: How to find the maximum uid that can be assgined?

The max amount of uids is defined by MAXINT. Check the file /usr/conf/sys/param.h and you'll see it's set to hex value 0x7fffffff which is over 2 billion, to be exact 2,147,483,647. But since root is 0, the correct number should be (MAXINT-1).
Crystal_1
Frequent Advisor

Re: How to find the maximum uid that can be assgined?

Hi,

I am working on a script to generat a specific uid for all users.

I have found a number of 2147483647 for HP-UX. However, I am not sure :

1. if differet O/S has different max_uid?
2. if different bit O/S has different max_uid?
3. where I can find the defined max_uid on a hp-ux 11.x system?

Tx
A. Clay Stephenson
Acclaimed Contributor

Re: How to find the maximum uid that can be assgined?

The value is 2^32 - 1 BUT for compatibility reasons especially in an NIS/NIS+ multi-platform environment I would keep them below 64K. At one time, SAM in 10.20 at least wouldn't allow a UID greater then 59,999.

Some versions of NFS also have problems with large uid's.

Unless you have a compelling reason to use uid's > 60K, I would avoid them.

If it ain't broke, I can fix that.
Steven Mertens
Trusted Contributor

Re: How to find the maximum uid that can be assgined?


here you can find all the man pages for
hpux :

http://docs.hp.com/hpux/onlinedocs/B2355-90682/B2355-90682.html
Crystal_1
Frequent Advisor

Re: How to find the maximum uid that can be assgined?

A.Clay,

How can u know it is 2^32-1, it is not 2^31?

Crystal

James R. Ferguson
Acclaimed Contributor

Re: How to find the maximum uid that can be assgined?

Hi Crystal:

Be careful if you use values > 60K. As noted in the 'tar' man pages: "tar does not
support the archival of files larger than 2GB or files that have user/group IDs greater than 60K. Files with user/group IDs greater than 60K are archived and restored under the user/group ID of the current process."

This also applies to 'cpio' and 'pax'.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: How to find the maximum uid that can be assgined?

You are correct! That was a typo on my part. It should be 2^31 - 1 --- the maximum value of a 32-bit two's complement integer.
If it ain't broke, I can fix that.
Wodisch_1
Honored Contributor

Re: How to find the maximum uid that can be assgined?

Hi Crystal,

for quite som etime now (pre Y2K, IIRC) user-ids can be 32bit (instead of the old 16bit ones). What happens is, when the first file is owned by a user-id > 65535 the whole file-system is silently converted to use 32bits for owner/group for ALL I-nodes...

HTH,
Wodisch