• 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: [Q] copy operation and authorization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] copy operation and authorization


  • Subject: Re: [Q] copy operation and authorization
  • From: JongAm Park <email@hidden>
  • Date: Thu, 12 Nov 2009 10:34:45 -0800

Nick Zitzmann wrote:
On Nov 12, 2009, at 10:44 AM, JongAm Park wrote:

NSString *PlugInPath = [NSString stringWithString:@"/Library/Application Support/Final Cut Pro System Support/Plugins/test3.valm"];

Apologies for being a little pedantic here, but calling +stringWithString: is almost never necessary and in this case is just cluttering the autorelease pool/garbage collector. You can set NSString pointers to NSString constants with no problems.

It's intermediate code. I have good reason to use stringWithString or stringWithFormat. It was revised to hide something from original code, but I didn't want to change much to post the code to the mailing list. So, I used remainder from the original code.


Although it returns "errAuthorizationSuccess" in "authorize" method, when a file is to be copied, it returns "fail" state and the file is not copied.
Can anyone help me to figure out why?

You cannot escalate the privileges of a running task on Mac OS X. So if a running task does not have root privileges, then it never will.


Then how?
Should I use AuthorizationExecuteWithPrivileges() and invoke an external command like "cp"?
I think it should be possible to copy files with proper privilege with Cocoa calls.

Yes. Apple actually wants you to use AEWP() to run your own helper tool for security reasons, though it's highly unlikely you'll run into problems by doing direct invocations. Check the list archives for details.

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


  • Follow-Ups:
    • Re: [Q] copy operation and authorization
      • From: Nick Zitzmann <email@hidden>
References: 
 >[Q] copy operation and authorization (From: JongAm Park <email@hidden>)
 >Re: [Q] copy operation and authorization (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: [Q] copy operation and authorization
  • Next by Date: Re: [Q] copy operation and authorization
  • Previous by thread: Re: [Q] copy operation and authorization
  • Next by thread: Re: [Q] copy operation and authorization
  • Index(es):
    • Date
    • Thread