简体   繁体   中英

Escalate App Privileges Programmatically OS X

I've done some digging and the main ideas I've seen floating around are using setuid/getuid and using the Authorization Services (which, for some reason gives me a symbol error when compiling but appears to be deprecated now).

My application needs to be able to request root access (for accessing a raw disk drive) at a certain point, preferably with the OS X authentication dialog (I'm new to OS X so I have no idea what to call that).

Authorization Services is pretty well supported, AFAIK.

Here's a link to a tutorial (with sample projects!) which you can use to launch a small tool in which you can get admin priviledges and then you can call the setpriority API on your calling process (documentation linked for you).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM