Re: How to get user ID (501, 502, etc.)
Re: How to get user ID (501, 502, etc.)
- Subject: Re: How to get user ID (501, 502, etc.)
- From: Andrew Satori <email@hidden>
- Date: Mon, 13 Nov 2006 09:40:27 -0500
I *think* this is an error in getuid() when run as an a user that has
administrator rights and has authenticated within the last few
minutes, I've no t tested it, but it appears to be around three
minutes. Interestingly, though getuid() returns 0, calling a task
using NSTask assuming that because you have a getuid() of 0 (root)
will fail with permission error because the NSTask is still run in
the context of the user, not the getuid() result of root.
When it comes to getting and using the console user, it can be
entertaining to say the least.
That said, the SystemConfiguration framework method works for getting
the current user. I've also seen a need on occasion to identify
other user id's using NetInfo (command line) or the OpenDirectory API
(http://developer.apple.com/documentation/Networking/Conceptual/
Open_Directory/index.html).
Andy
On Nov 11, 2006, at 5:22 PM, Rosyna wrote:
0 is root. Is this application running as root?
Ack, at 11/11/06, Jerry Krinock said:
Thanks. getuid() returns 0, but this gives the name, user ID and
group ID
if you need them..........
--
Sincerely,
Rosyna Keller
Technical Support/Carbon troll/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden