Re: Communicate with pipe and AuthorizationExecuteWithPrivileges
Re: Communicate with pipe and AuthorizationExecuteWithPrivileges
- Subject: Re: Communicate with pipe and AuthorizationExecuteWithPrivileges
- From: Jorge Salvador Caffarena <email@hidden>
- Date: Wed, 27 Jun 2001 11:56:53 +0200
Well, I tried this and it did not work. I continue to get a deadlock
with the infamous Beachball Of Death. I did some research and it happens
to lock because AuthorizationExecuteWithPrivileges do not seem to close
the FILE when the executed application ends with output.
El lunes, 25 junio, 2001, a las 08:13 , Sven A. Schmidt escribis:"
I'm using the following successfully, which is from Ben Lachman's
BLAuthentication framework, which again is based on Brian Hill's
article on the Authorization framework on stepwise.
outputData = [NSMutableData data];
tempData = [NSMutableData dataWithLength:512];
do {
[tempData setLength:512];
//read the output of the task using fread or any other
//standard FILE function.
//You should also be able to write to the task if needed
//(but don't if it's not needed, or you'll get a SIGPIPE).
len = fread([tempData
mutableBytes],1,512,communicationsPipe);
//NSLog( @"len: %i", len );
if(len>0) {
[tempData setLength:len];
[outputData appendData:tempData];
}
} while(len==512);
Like I said, this works, but I've encountered the same symptom as you
whenever I tried to write to the same pipe I before I read from it.
HTH,
Sven
Jorge Salvador Caffarena
got to see the light - got to see the light
that lights other lights
got to feel the sound - got to feel the sound
that comes over silence
http://homepage.mac.com/eevyl/