[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (no subject)

From: Bob Proulx
Subject: Re: (no subject)
Date: Mon, 11 Jun 2001 14:14:22 -0600

> Only root can use chown, other users can't change their files owner or
> group.
> My book says that you can.
> Is this a configuration issue or a bug?

You are asking a question which is commonly asked.  I will quote a
previous response to this question.

> The chown man and info pages do not document the facts that only root can
> change the ownership of a file, and that the setuid bits on files are
> reset when they are chowned.

Actually, the GNU chown command does not know if this is the policy of
the system or not.  It calls the kernel chown command.  If the OS
allows it then it will change the ownership of the file.  Different
systems handle this differently.  Traditional System V UNIX systems
allow anyone to give a file away to other owners.  On those systems
GNU chown does change the ownership of files.

On most modern systems BSD symantics are followed and only root can
change the ownership of the file.  The problem for documenting this is
that GNU chown does not know which it will be running on.  This is
really an OS policy decision and it is hard to track documentation to
be different on different systems.

The reason to restrict ownership is mostly threefold.  One is that
people have used this to avoid quota restrictions.  Give the file to
someone (like root) with disk quota to spare.  Two is that you can
deny someone service by using all of their quota.  Three is that a
user can create files that cannot be removed except by the owner and
then change the owner.  That puts them into a state that only the
superuser can fix.  Therefore most systems today have changed to
disallow giving file ownership away.  But it has not always been that


reply via email to

[Prev in Thread] Current Thread [Next in Thread]