[Pythonmac-SIG] How to run an app bundle as root?

Arve Knudsen arve.knudsen at gmail.com
Fri Nov 3 17:54:29 CET 2006


Yes, that would be my ideal approach. I simply don't have the time to
implement this at the moment however (I need a running prototype). Besides,
the OS X Installer operates this way already.

Thanks,
Arve Knudsen

On 11/3/06, Bob Ippolito <bob at redivi.com> wrote:
>
> On 11/3/06, Arve Knudsen <arve.knudsen at gmail.com> wrote:
> > Hello
> >
> > I'm writing a custom installation tool for OS X, which needs to run with
> > root privileges. The installation tool is packaged into an app bundle by
> way
> > of py2app. What I basically need to know is the best way of attaining
> root
> > privileges in the tool, must this be done with
> > AuthorizationExecuteWithPrivileges? I first tried this
> > approach, writing a wrapper script which executes the main script in a
> > privileged Python process. This doesn't quite work however, the
> resulting
> > window behaves completely different from what one would expect. That is,
> it
> > can't get focus and I can't command-tab to it.
> >
> > I thought of another approach, which is to first run a privileged
> program
> > which setuid's the bundle executable, and then re-execute the bundle.
> Would
> > this be a good approach, and how can I execute the bundle
> programmatically?
> >
>
> Sounds like you're taking the wrong strategy here. The idea is to use
> the privileged helper process to do *only* privileged operations.
> Don't use it for UI stuff. That's just dangerous.
>
> -bob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20061103/8b635db4/attachment.htm 


More information about the Pythonmac-SIG mailing list