Escalate Privileges in OSX

123 views Asked by At

I'm writing a simple OSX application to write firmware to a USB device. I'm using libusb to perform I/O.

My first pass at this works perfectly, provided I run it with sudo. I'm now creating a GUI version of the tool and I'd like to prompt the user to escalate.

I know the "correct" way to do this is with a privileged helper but I also need to report back progress to the UI, and I don't feel like building out IPC for something this simple.

Is there a simple way to request root or USB write privilege from the user for a GUI app?

1

There are 1 answers

0
Tim On BEST ANSWER

I gave up and used the deprecated AuthorizationExecuteWithPrivilege API to re-launch my app if I didn't have root privilege.

It strikes me as a way less than optimal solution, if anyone has a better idea, I'd love to hear it.