> According to several Linux source books the owner of a file should be
> able to change the ownership of that file to another user.  (This is
> assuming the owner is NOT root.)  However, this does not seem to be the
> case.  For example:
[...]
> Do you have any comments or knowledge of this problem with the Linux
> chown command?

That is a policy decision of the kernel.  The chown command only has
the permissions of the chown system call in the kernel.

Traditional UNIX systems allowed users to give files away to other
users.  Generally that works great.  However, in some situations that
can cause problems.

For example it is possible to create a directory of files and chmod
them and chown them to root such that you cannot remove them as a
normal user.  Only the superuser can clean up the problem.  It is
somewhat like getting your car stuck in a ditch and needing a two
truck to pull you out.

Another issue is when accounting and quotas are used to control disk
space allocations.  Well, I might find that I have only a small amout
of space that I can keep as myself.  But 'root' has an unlimited
amount.  Therefore I can hide my files by chowning them to root.  Now
they don't show up in the accounting or quotas as belowing to me.
Another problem with quotas and chown is that I can prevent other
users from accessing the machine.  I can chown a large amount of disk
space to another user and use their quotas up and deny them service.

For these reasons and I am sure others Linux has picked the policy
that you cannot chown files to other users unless you have superuser
permissions.  I am sure you could reconfigure the kernel to allow that
operation and then it would be like traditional UNIX machines.  But it
also makes a certain amount of sense and so I would recommend against
it.

Bob

Reply via email to