My app runs as the root
user, but was launched from the regular (Admin) user, e.g. using the sudo
command (but not necessarily, i.e. I cannot simply check the env var SUDO_USER
, for instance).
How can I determine the user name or its homedir that is logged in to the User Interface session?
Is there a Cocoa, Foundation or CoreFoundation function that can give me that information?