Re: Reading data from the pipe in AuthorizationExecuteWithPrivileges() ??
Re: Reading data from the pipe in AuthorizationExecuteWithPrivileges() ??
- Subject: Re: Reading data from the pipe in AuthorizationExecuteWithPrivileges() ??
- From: Mark Williams <email@hidden>
- Date: Tue, 4 Oct 2005 22:09:27 -0700
Ok, So yeah pretty much what the authsample does.
I'll try it from that approach. Maybe I'll be able to get it going
that way.
Thanks,
Mark.
On Oct 4, 2005, at 9:46 PM, Manfred Bergmann wrote:
I think I had a look and the example. IIRC this was about repairing
the SUID bit if has been lost somehow.
The approach could work like this:
You have your main application and a BSD tool.
1. get a AuthenticationRef (preauthorize) in application
2. start BSD tool with NSTask (and set up stderr, stdout pipes)
3. pass preauthorized AuthenticationRef through pipe to BSD tool
4. check authorization in BSD tool
5. if authorization is ok, call sometool using system() function
6. collect stdout and stderr streams and pass them to application
Manfred
Am 05.10.2005 um 14:03 schrieb Mark Williams:
I'm not real sure how to go about that. Is this similar to the
self repair done in the auth samples?
Mark.
On Oct 4, 2005, at 8:59 PM, Manfred Bergmann wrote:
Am 05.10.2005 um 13:38 schrieb Mark Williams:
Well this doesn't seem to make a difference either. I'm still
getting nothing in the dittoOut file. I tried doing /bin/sh. But
isn't that against apple's security? I mean to execute a shell
and then a command in it? I'm thinking it must be in the way I'm
trying to read the the output.
What about using the installer (SUID Tool) approach. I have never
done that, but I thought about it because I have a little project
where I have the same problem of collecting the stderr stream
when executing with privileges.
You then could collect the stderr streams in the SUID tool
yourself and pass them though a pipe to the caller.
But just a thought, not tested.
Manfred
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden