• 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: AuthorizationExecuteWithPrivileges deprecated
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AuthorizationExecuteWithPrivileges deprecated


  • Subject: Re: AuthorizationExecuteWithPrivileges deprecated
  • From: Charles Srstka <email@hidden>
  • Date: Wed, 11 Sep 2013 10:34:39 -0500

On Sep 11, 2013, at 5:53 AM, Gerriet M. Denkmann <email@hidden> wrote:

> I have this code:
>
> AuthorizationRef	auth;
> OSStatus aa = AuthorizationCreate( NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &auth);
>
> const char *pathToTool = [ theHelperPath fileSystemRepresentation ];
> const char *const arguments[] = { "--self-repair", NULL };
> FILE *communicationsPipe;
> aa = AuthorizationExecuteWithPrivileges	(  	auth,
> 											pathToTool,
> 											kAuthorizationFlagDefaults,
> 											(char * const *)arguments,
> 											&communicationsPipe
> 										);
>
> int fileDescriptor = fileno( communicationsPipe );
> NSFileHandle *readHandel = [ [ NSFileHandle alloc ] initWithFileDescriptor: fileDescriptor ];
>
> ... some reading from readHandel
>
> int yy = fclose( communicationsPipe );
>
> works fine, but Xcode is telling me that AuthorizationExecuteWithPrivileges is deprecated since 10.7.
>
> I asked Xcode about this (expecting something like: "use this instead") but got no answer.
>
> So what to do?
> My HelperTool needs to run as root. How is this to be done?

You have to use SMJobBless to install the tool as root, and then pick your favorite form of IPC to communicate with it (XPC is best, if you can require 10.7).

Charles


_______________________________________________

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: AuthorizationExecuteWithPrivileges deprecated
      • From: Jerry Krinock <email@hidden>
References: 
 >AuthorizationExecuteWithPrivileges deprecated (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: ARC vs Manual Reference Counting
  • Next by Date: Re: ARC vs Manual Reference Counting
  • Previous by thread: AuthorizationExecuteWithPrivileges deprecated
  • Next by thread: Re: AuthorizationExecuteWithPrivileges deprecated
  • Index(es):
    • Date
    • Thread