Communicate with pipe and AuthorizationExecuteWithPrivileges
Communicate with pipe and AuthorizationExecuteWithPrivileges
- Subject: Communicate with pipe and AuthorizationExecuteWithPrivileges
- From: Jorge Salvador Caffarena <email@hidden>
- Date: Mon, 25 Jun 2001 18:10:22 +0200
Here I am again with a question about
AuthorizationExecuteWithPrivileges. The only documentation I have found
on this function is on its header file, and it is short and not very
helpfull sometimes.
I want to get the output of the tool I execute with
AuthorizationExecuteWithPrivileges, but when I use a FILE * handler,
after trying to read from it my app enter some kind of deadlock and the
Beachball Of Death appears. Here is the code:
err = AuthorizationExecuteWithPrivileges(authorizationRef,
"/sbin/shutdown",0,args,&output);
fread(buffer,1,4096,output);
NSLog(@"%s\n",buffer);
The variable "output" is of type "FILE *" and the NSLog do not execute,
what am I doing wrong?
Thanks in advance,
Jorge Salvador Caffarena
http://homepage.mac.com/eevyl/