开发者

What kind of API should I use to elevate user privilege to super-user in a Mac OS X?

开发者 https://www.devze.com 2023-01-04 16:14 出处:网络
I want to elevate my app\'s privilege to super-user. Installer app supports this by displaying this dialog.

I want to elevate my app's privilege to super-user. Installer app supports this by displaying this dialog. How can I show this dialog to elevate privilege?

PS. I'm making a kind开发者_JAVA技巧 of packet sniffer application on Mac OS X. I'm using pcap lib. (which is part of tcpdump)


AuthorizationExecuteWithPrivileges with kAuthorizationRightExecute

See BetterAuthorizationSample

As a general rule, you should not run GUI applications as root. You should make a command line tool that you can run as root, and control it from your user space GUI application.

0

精彩评论

暂无评论...
验证码 换一张
取 消