Is it possible to run NSTask as user ?

Discussion in 'Mac Programming' started by GokulKrish, Apr 12, 2014.

  1. GokulKrish macrumors newbie

    Apr 12, 2014
    I am using LaunchDaemon , which launches a binary from root session .

    Now ,when I execute shell command using NSTask , It would run as a root User .(Example : I run "whoami" , It would respond as "root")

    Is it possible to run NSTask (from daemon launched binary ) as a loggedon user ? (Example : I run "whoami" , It should respond as "UserName")

Share This Page