Opened 14 years ago

Closed 14 years ago

Last modified 11 years ago

#11596 closed defect (fixed)

BUG: nextuid creates GUI users (uid >= 500) rather than "hidden" users (<500)

Reported by: matt@… Owned by: macports-tickets@…
Priority: Low Milestone:
Component: base Version:
Keywords: Cc:


When a port such as dbus creates a user using the adduser function, the user will be visible in the Accounts Preference pane etc. This is because Mac OS X treats uids >= 500 as login users, and pextlib's nextuid function just takes maxuid+1 for the userid.

A better approach in NextuidCmd() in Pextlib.c would be to do something like

int uid = 100; while (getpwuid(uid)) {


} tcl_result = Tcl_NewIntObj(uid);

or similar (I haven't tested this code).

Change History (8)

comment:1 Changed 14 years ago by pipping@…

Milestone: MacPorts 1.4

comment:2 Changed 14 years ago by jmpp@…

Milestone: MacPorts 1.4Needs developer review
Type: defectenhancement

Good suggestion, but I cannot tell on my own what implications it might have. Setting it to "Needs developer review" for now. Thanks for the report!


comment:3 Changed 14 years ago by kballard (Lily Ballard)

Resolution: fixed
Status: newclosed

I just fixed this in r23720 without being aware of the existence of the ticket :)

Anyway, nextuid and nextgid both pick up the first uid/gid >= 100, using basically the same code you pasted.

comment:4 Changed 14 years ago by jmpp@…

This was reverted by Landon because users with uid's < 500 are reserved for system usage. I'll keep the ticket closed since the original suggestion is not entirely applicable, but I'll leave the ticket in this milestone and wont mark it as "invalid" in case someone wants to work on it to find a better solution (hidden users with uids > 500? I think Landon said there is a way to accomplish that, though he didn't remember it at the moment).


comment:5 Changed 14 years ago by jmpp@…

Milestone: Needs developer reviewMacPorts base bugs

Milestone Needs developer review deleted

comment:6 Changed 14 years ago by nox@…

Priority: Nice to haveLow
Type: enhancementdefect

comment:7 Changed 12 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

comment:8 Changed 11 years ago by jmroot (Joshua Root)

Milestone: MacPorts Future
Note: See TracTickets for help on using tickets.