useradd and UID allocation

From: binish@binish.net
Date: Wed Dec 28 2005 - 08:34:12 EST


Hi All,

This is a general question regarding useradd command.
I've some doubts regarding UID allocation.
man page suggests that the UID defaults to the next available (unique) number
above the highest number currently assigned. For example, if UIDs 100, 105, and
200 are assigned, the next default UID number will be 201. (UIDs from 0-99 are
reserved for possible use in future applications.).
My question is: from where does useradd finds this highest numbered uid
allocated?
Is it /etc/passwd ??

If it is, then in one of my machines,
this scheme ( next available ) is not followed.
Following is the passwd file entries ( not the complete one, i think this much
is sufficient ) The user I am trying to create is myuser.

nobody:x:60001:60001:Nobody:/:
noaccess:x:60002:60002:No Access User:/:
nobody4:x:65534:65534:SunOS 4.x Nobody:/:
ssmon:x:60000:60001:Sun StorEdge(tm) Configuration Service Agent
Monitor:/:/bin/false
ssadmin:x:59999:60001:Sun StorEdge(tm) Configuration Service Agent
Admin:/:/bin/false
ssconfig:x:59998:60001:Sun StorEdge(tm) Configuration Service Agent
Config:/:/bin/false
myuser:x:60011:100::/export/home/myuser:/bin/ksh

According to the allocation scheme, the uid of myuser should be
60003 but its 60011. I've verified that 60003 is not present in /etc/passwd
file.
Does that mean useradd is reading the next uid to be allocated from some other
files?

Thanks,
Binish
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:38:09 EDT