On Sep 18, 2009, at 4:46 PM, Scott Haneda wrote:
Where does adduser/addgroup get the uid and gid to start with so it does not have collisions?

The best way to answer a question like this, is to look at the source:

http://trac.macports.org/browser/trunk/base/src/port1.0/portutil.tcl

proc adduser sets the uid by calling nextuid

nextuid is from Pextlib.c:

http://trac.macports.org/browser/trunk/base/src/pextlib1.0/Pextlib.c

There you can see that nextuid is implemented by NextuidCmd, which starts at MIN_USABLE_UID (which is set to 500) and increments until it finds an unused uid. (It uses the same algorithm to find an unused gid).

--
Daniel J. Luke
+========================================================+
| *---------------- [email protected] ----------------* |
| *-------------- http://www.geeklair.net -------------* |
+========================================================+
|   Opinions expressed are mine and do not necessarily   |
|          reflect the opinions of my employer.          |
+========================================================+



_______________________________________________
macports-dev mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

Reply via email to