Re: AuthSample
Re: AuthSample
- Subject: Re: AuthSample
- From: "Andrew James" <email@hidden>
- Date: Mon, 29 Oct 2007 19:17:49 +1030
Hi,
So it seems the newer version of Leopard is whats dropping the privs,
however what is the best way to retrieve the return value of the commands if
i use fork/exec
On 10/29/07, Nick Zitzmann <email@hidden> wrote:
>
>
> On Oct 28, 2007, at 5:38 AM, Andrew James wrote:
>
> > I use a loader in my program to achieve root powers, however for
> > some reason
> > in leopard it has become broken. The code is based off authsample
> > and works
> > if i use a fork to execute the commands
> > (chown/chmod/kextload/kextunload/pmset) however if i place a simple
> > system()
> > call it fails to achieve the root powers. Now to my understanding a
> > fork
> > should have the exact same powers as the parent.
> >
> > So does anyone know why the fork is needed?
>
>
> I bet it failed for security reasons. system() invokes a command using
> a shell, and running a shell as root (or with root privileges) is
> generally a bad idea. Try using fork/exec instead of system().
>
> Nick Zitzmann
> <http://www.chronosnet.com/>
>
>
>
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden