我应该使用什么样的API来提升Mac OS X中超级用户的用户权限? [英] What kind of API should I use to elevate user privilege to super-user in a Mac OS X?
问题描述
安装程序通过显示此对话框来支持此操作。
如何显示此对话框来提升权限?
PS。
我正在Mac OS X上制作一种数据包嗅探器应用程序。我正在使用pcap lib。 (它是tcpdump的一部分)
AuthorizationExecuteWithPrivileges with kAuthorizationRightExecute
作为一般规则,您不应以root身份运行GUI应用程序。您应该创建一个可以以root身份运行的命令行工具,并从用户空间GUI应用程序中进行控制。
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 of packet sniffer application on Mac OS X. I'm using pcap lib. (which is part of tcpdump)
AuthorizationExecuteWithPrivileges with kAuthorizationRightExecute
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.
这篇关于我应该使用什么样的API来提升Mac OS X中超级用户的用户权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!