• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Wrapping Command Line Tools
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Wrapping Command Line Tools (From: Tommy Nordgren <email@hidden>)

  • Prev by Date: Re: NSString to char[]
  • Next by Date: Re: Regex? Need to style portions of text that are not all the same
  • Previous by thread: Wrapping Command Line Tools
  • Next by thread: Re: Wrapping Command Line Tools
  • Index(es):
    • Date
    • Thread