Re: Wrapping Command Line Tools
Re: Wrapping Command Line Tools
- Subject: Re: Wrapping Command Line Tools
- From: James Bucanek <email@hidden>
- Date: Fri, 29 Jul 2005 06:53:17 -0700
Tommy Nordgren wrote on Friday, July 29, 2005:
>I wonder about how I can wrap Unix Command Line Tools with Cocoa. I
>need to catch the standard err stream,
>and redirect it to a window as well.
>Note that I cant use the standard popen call for this reason, as well
>as for the reason that it is an insecure call
>(I might need to run some tools as root)
>What I want to do is the following call the tools with the standard
>IO streams redirected to windows in my app.
>I need to use calls that launches the tool securely, bypassing the
>shell. Then I will need to redirect the streams
>to panes in a window, after some filtering.
>Thankful for any useful hints.
Cocoa class for launching processes: NSTask
Carbon API for launching a process as root: AuthorizationExecuteWithPrivileges
Note that there are security implications of running a process with admin privileges. If this is an in-house application, then it's probably not a big issue. But if you are creating something for general consumption you should familiarize yourself with the security risks.
--
James Bucanek <mailto:email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden