Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting the User/Owner of another process



I need to be able to get the User/Owner of another process, like Finder. I
need to do this because I need to get the user name of the person currently
logged in. Now before you berate me, I did try to use NSUserName(),
NSFullUserName() functions.

There seems to be a very subtle bug in these functions. These functions were
unsuccessful because I am trying to get the user name of the person currently
logged in, in the Startup Item I am using, but contrary to the documentation
for these two functions, they do not get the User Name of the user currently
logged in they get the User Name of WHOEVER HAS OWNERSHIP OF THE APPLICATIONS
PROCESS (for Startup Items this seems always to be Root).

So I need to someway get the name of the person logged in, in a Startup Item
so I can setup the last preferences for the app and driver I am writing. The
only way I have thought of to do this, is to be able to get the User Name of
the user that owns the Finder process (which always seems to have the current
logged in user as the owner of that process... see the Process Viewer). Does
anyone have any suggestions on how to do this, or how to otherwise get the
current users login name in a Startup Item?

Thanks,

John D. Farmer
_______________________________________________
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.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.