I have a program that runs as the root user (
getuid() returns 0).
I need to execute a command line tool as the user that’s currently logged in (which I can determine by getting the HOME env var, it seems).
How do I do that, ideally by using
I know how to execute the tool using NSTask as the current (root) user, so all I need is to know what I need to change about that.