slackware 12.0
linux-2.6.22.6
I'm trying to chown my file but I get an error:
$ ls -l
-rw-r--r-- 1 dc root 6 2007-12-03 19:03 test
$ chown nobody test
chown: changing ownership of `test': Operation not permitted
From the manpage of chown(2):
"Only a privileged process (Linux: one with the CAP_CHOWN capability)
may change the owner of a file. The owner of a file may change the
group of the file to any group of which that owner is a member."
Does it mean that I can't change the owner of arbitrary file that
belongs to me??? How can I enable CAP_CHOWN for myself by default to
be able to change owner.
Thanks in advance
Yes. If users could change the ownership of files belonging to them,
they could very easily defeat per-user disk quotas.
sudo chown
> Does it mean that I can't change the owner of arbitrary file
> that belongs to me???
Yes, that is for two main reasons:
* One could circumvent disk quotas, or exceed the disk quota of
anoter user.
* One could set a executable SUID/SGID and then chown root:root
thus gaining superuser privileges.
Wolfgang Draxinger
--
E-Mail address works, Jabber: hexa...@jabber.org, ICQ: 134682867
> * One could set a executable SUID/SGID and then chown root:root
> thus gaining superuser privileges.
from chown(2):
"When the owner or group of an executable file are changed by a non-
superuser, the S_ISUID and S_ISGID mode bits are cleared."
so the above reason is the case