开发者

Prompt for root access in cocoa application

开发者 https://www.devze.com 2023-03-07 16:47 出处:网络
I want my program to begin with a prompt/alert that asks for root access. The user must enter their password, and then the application follows. I\'ve been looking开发者_如何学运维 around, but I\'m not

I want my program to begin with a prompt/alert that asks for root access. The user must enter their password, and then the application follows. I've been looking开发者_如何学运维 around, but I'm not exactly sure how to do this.

You help is greatly appreciated.

Thanks!


This is Apple's documentation on the matter, and here is a good example of it.


Use BLAuthentication. Its much easier to launch authorization as root and you can enter bash commands to run as root.

http://jim.roepcke.com/blog/archives/2002/09/24/blauthentication-class.html

0

精彩评论

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