• 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: Communicate with pipe and AuthorizationExecuteWithPrivileges
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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/


  • Follow-Ups:
    • Re: Communicate with pipe and AuthorizationExecuteWithPrivileges
      • From: "email@hidden" <email@hidden>
References: 
 >Re: Communicate with pipe and AuthorizationExecuteWithPrivileges (From: "Sven A. Schmidt" <email@hidden>)

  • Prev by Date: Re: NSTask and NSPipe
  • Next by Date: Strange service behavior.
  • Previous by thread: Re: Communicate with pipe and AuthorizationExecuteWithPrivileges
  • Next by thread: Re: Communicate with pipe and AuthorizationExecuteWithPrivileges
  • Index(es):
    • Date
    • Thread