Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Kaliemon

macrumors member
Original poster
Apr 30, 2006
93
1
I making a program that needs to edit a certain system file. However the since the file is owned by the system I need to get Administrator permission, similar to Installer. Can someone please post an example of doing this in either Ruby or Obj-C, or even C++.

I know I can run the app through terminal with sudo, but the people who it is for do not want to need to open terminal.

Thanks
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
You can use AuthorizationExecuteWithPrivileges() (lots of examples on the web) to do this. You'll need to write a separate utility that writes to the file.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.