AuthorizationExecuteWithPrivileges deprecated
AuthorizationExecuteWithPrivileges deprecated
- Subject: AuthorizationExecuteWithPrivileges deprecated
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Wed, 11 Sep 2013 17:53:51 +0700
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?
Gerriet.
_______________________________________________
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