how to run my app in privileged mode

2008-06-03 Thread Nick Rogers
Hi, I wish to access disk sectors using open() and pread(). but it fails for the system disk. So how can I get the user to type in admin passwd and then run my app in privileged mode. Please point me to any sample code etc. I tried BetterAuthorizationSample code from apple, but using it to

Re: how to run my app in privileged mode

2008-06-03 Thread Michael Vannorsdel
You can't really upgrade an already running process's privilege level. What I'd suggest is make a small launcher program that the user opens. This would ask for the admin password and then launch your main application using AuthorizationExecuteWithPrivileges and friends. On Jun 3,

Re: how to run my app in privileged mode

2008-06-03 Thread Jean-Daniel Dupas
Note that you should never run a GUI application with elevated provilege, particulary an application that uses AppKit, this is EVIL. See man authopen(1). This is built-in an helper tool design to read and write file using auth services. It handle all the authorization part for you. And

Re: how to run my app in privileged mode

2008-06-03 Thread Charles Srstka
On Jun 3, 2008, at 2:08 PM, Jean-Daniel Dupas wrote: Note that you should never run a GUI application with elevated provilege, particulary an application that uses AppKit, this is EVIL. Just to explain a bit *why* this is evil and why you absolutely should not do this, here's a little