Re: current user if started from /Library/StartupItems
Re: current user if started from /Library/StartupItems
- Subject: Re: current user if started from /Library/StartupItems
- From: Sherm Pendley <email@hidden>
- Date: Mon, 3 Feb 2003 20:25:26 -0500
On Monday, February 3, 2003, at 08:06 PM, Frank Fenn wrote:
The problem is that every function NSUserName, getenv("USER"),
getiud() returns the root user.
That's not a bug, it's a *feature*. :-) Those functions are returning
the correct answer, as anything that's run as a StartupItem is run as
root.
How do I get the actual console user?
You could periodically do a "ps -alx" and parse its output to see what
user ID the Finder, Dock, WindowServer, etc., are running under.
sherm--
UNIX: Where /sbin/init is Job 1.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.