Re: Privileged write to file
Re: Privileged write to file
- Subject: Re: Privileged write to file
- From: Charles Srstka <email@hidden>
- Date: Wed, 10 Mar 2004 19:20:40 -0600
I still don't understand the logic behind this.
Wouldn't it be trivial then to write a malicious app that launches your
setuid root tool, pretends it's your app, and then uses the tool to
copy files to all sorts of locations where they can do damage?
Charles
On Mar 10, 2004, at 3:29 AM, Nicko van Someren wrote:
On 9 Mar 2004, at 22:24, Sam McCandlish wrote:
Does anyone know of a way I can write to a file with admin privileges
using the Apple security methods? I am trying to write to a
configuration that you can only be written to by root.
The right way to do this is probably to write a tiny program that
writes the configuration file and install it owned by root with the
setuid permission bit set.
Note that the wrong way to do this is that you could write the file to
a temporary location and then call
AuthorizationExecuteWithPrivileges() to issue a "cp" command to copy
the file to the right place. This is a bad idea because you program,
which is not setuid root, could have its binary modified to change
what gets passed to the authorisation call.
See
http://developer.apple.com/documentation/Security/Reference/
authorization_ref/01authref_ref/function_group_5.html#//apple_ref/c/
func/AuthorizationExecuteWithPrivileges and the related pages.
Nicko
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.