Tim
Tim

Reputation: 4823

Escalate Privileges in OSX

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?

Upvotes: 1

Views: 140

Answers (1)

Tim
Tim

Reputation: 4823

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.

Upvotes: 1

Related Questions