On Sat, 29 Jan 2000, Drew Mazurek wrote:
> If I own the directory that I'm currently in, and I own the file I
> want to modify, why can't I chown a file to someone else?
There are a few reasons this is generally the case on Unix:
* Quota systems tend to use file ownership to decide how much space each
user is taking up.
* Ownership of files is useful when you're trying to reconstruct past
activities. That is, it can leave a useful "audit trail" that an
intruder could obscure if he could chown stuff away.
* Similarly, if you can "trust" file ownership, some programs arguably
become easier to write. (My code, for example, can just check ownership
on a file you put somewhere to ensure that you were really the one who
put it there.)
Some systems (e.g., Solaris) can be configured to allow this operation for
normal users, but it's a bad idea in most environments. (As you can see,
the drawbacks aren't awful, so it's not THAT bad an idea.)
The POSIX standard, if you care, requires the behavior you've observed.
Interestingly enough, Windows NT restricts evern administrators from
giving away files; even if you're an administrator, you have to give
someone the "Take Ownership" privilege and then wait for them to exercise
it in order for ownership to actually be transferred. (That's, at least,
what Microsoft says. It turns out to be easy to circumvent this
restriction, even without writing a line of code and just 'misusing' the
tools that MS provides.)
Shawn
This archive was generated by hypermail 2b29 : Wed Apr 27 2005 - 03:30:03 EDT