Re: Communicate with pipe and AuthorizationExecuteWithPrivileges
Re: Communicate with pipe and AuthorizationExecuteWithPrivileges
- Subject: Re: Communicate with pipe and AuthorizationExecuteWithPrivileges
- From: "email@hidden" <email@hidden>
- Date: Wed, 27 Jun 2001 21:08:43 +0200
what kind of application did you execute? i've got the same problem
trying to start a daemon and catching the output. as the daemon (server)
continues to run in background, AuthorizationExecuteWithPrivileges won't
close the pipe as the application is still running....
i found no "real" solution for the problem. in fact i'm redirecting the
output of the process on shell level and reading the file afterwards. i
don't know if this is a possible solution for your problem. if you find
anything else, please let me know.
there are also other problems with AuthorizationExecuteWithPrivileges.
i.e. there is no possibility to set the environment for the task your
calling. i hope apple will do their homework and provide an usable
solution with one of the next updates.
thomas.
Am Mittwoch, 27. Juni 2001 um 11:56 schrieb Jorge Salvador Caffarena:
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/
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev