All pastes #968422 Raw Edit

Stuff

public text v1 · immutable
·published 2008-04-03 00:50 UTC
rendered paste body
	char *args[1];
	args[0] = NULL;
	FILE *returnVal;
	status = AuthorizationExecuteWithPrivileges(authorizationRef,
												[[[[NSBundle mainBundle] pathForResource:@"testutil" ofType:nil] stringByStandardizingPath] UTF8String],0,
												args, &returnVal);
	char *buffer;
	long lsize;
	fseek(returnVal, 0, SEEK_END);
	lsize = ftell(returnVal);
	rewind(returnVal);
	buffer = (char *) malloc(sizeof(char)*lsize);
	
	fread(buffer, 1, lsize, returnVal);
	fclose(returnVal);
	NSLog(@"Pipe: %s", buffer);