PDA

View Full Version : Ruby or Obj-C request administrator privileges




Kaliemon
Dec 17, 2008, 01:20 PM
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
Dec 17, 2008, 03:26 PM
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.