Reputation: 1335
I'm writing a cocoa app which needs to modify system proxy settings ( I'm using networksetup
to do that ).The problem is that it needs system administrator level access to change proxy settings. I tried running both running an NSTask
as administrator using Apple's default API ( I used STPrivilagedTask
wrapper for it ) and running a shell script with administrator privileges. It works perfect either way, but the problem is that my app needs to change settings so many times, and user has to type his password every single time.
Is there anyway that I can get the privilege one time, and use it again and again ?
Upvotes: 3
Views: 153
Reputation: 89509
What you're looking to do is write a "privileged helper tool" which gets included (or delivered, or embedded) in your application bundle and you can then call using SMJobBless()
.
Creating a helper tool is not for the faint of heart, but here is a related question with answers that may set you off down the right path.
Upvotes: 1