Re: Security bug in OS X / Cocoa (NOT!)
Re: Security bug in OS X / Cocoa (NOT!)
- Subject: Re: Security bug in OS X / Cocoa (NOT!)
- From: email@hidden
- Date: Sun, 17 Feb 2002 21:09:35 -0500
On Friday, February 15, 2002, at 12:41 PM, David Feldman wrote:
It looks to me like the writeToFile:atomically: routine can overwrite an
existing file, regardless of its ownership and permissions, as long as
the
user has write permissions on the directory. Isn't that a little bit
of a
security problem?
This is not a bug, it is completely in line with the semantics of
directory writeability on UNIX systems. If you can write to a directory,
that means you can add, remove, or change (the name of) entries (file,
directories, devices, etc.) in that directory. So if you have write
access on a directory that contains the file "foo", you can remove "foo"
and replace it with something else. This is true even if you have NO
access to the contents of the original "foo", because the delete
operation does not involve the permissions associated with "foo", but
only involves the permissions associated with the directory that
contains "foo".
Note that the capabilities granted by directory write permissions are
modified by the presence of the "sticky" and "text" permission bits. See
"man 2 chmod" for more detailed info.
Hope that helps,
email@hidden
_______________________________________________
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.