locked
run application with root privileges when a user run the application RRS feed

  • Question

  • User304418 posted

    is there a way to prompt the user/pass and get file access etc.. i need to write files and create launch daemon but i need root privileges for doing it

    Monday, March 13, 2017 5:39 PM

All replies

  • User35201 posted

    I believe SMJobBless is the "preferred way":

    https://developer.apple.com/library/content/samplecode/SMJobBless/Introduction/Intro.html

    but i hear the API is a beast and I know of no samples.

    This old post might be helpful:

    https://forums.xamarin.com/discussion/2810/elevated-permissions

    This might be useful as well:

    http://atnan.com/blog/2012/02/29/modern-privileged-helper-tools-using-smjobbless-plus-xpc/

    If you get something working, please feel free to post. I've never personally dug into this, and I'd like to know. :)

    Monday, March 13, 2017 6:22 PM