[xubuntu-users] security problem?
sandyinchina at gmail.com
Mon Jul 30 01:50:49 UTC 2012
On Wed, Jul 25, 2012 at 12:14 AM, Wybo Dekker <wybo at xs4all.nl> wrote:
> When I create a file in my home directory as root:
> $ sudo touch test
> I get:
> $ ls -l test
> -rw-r--r-- 1 root root 0 2012-07-24 18:09 test
> I cannot, without sudo, overwrite this file, but I can remove it with rm
> -rf. Is that correct? And if not: how can I find out what's wrong with
> my system?
rm does not change data inside the file, or the inode data that tells
the system where the file data is. It only changes the directory
info that associates a name with that inode number.
Therefore, for rm to work you need write access for the directory,
not for the file. This may be a bit counter-intuitive, but it has
been standard for any Unix variant since before I learned it in
the early 80s.
More information about the xubuntu-users