标签: objective-c cocoa macos root-access
我希望我的程序以提示/警报开始,要求root访问权限。用户必须输入他们的密码,然后是应用程序。我一直在四处寻找,但我不确定如何做到这一点。
非常感谢您的帮助。
谢谢!
答案 0 :(得分:3)
This is Apple's documentation on the matter和here is a good example of it。
答案 1 :(得分:2)
使用BLAuthentication。以root身份启动授权要容易得多,您可以输入bash命令以root身份运行。
http://jim.roepcke.com/blog/archives/2002/09/24/blauthentication-class.html