bug-fileutils
[Top][All Lists]
Advanced

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

Re: *POSSIBLE BUG IN `rm' AND `chown'*


From: Bob Proulx
Subject: Re: *POSSIBLE BUG IN `rm' AND `chown'*
Date: Sun, 28 Jan 2001 15:16:30 -0700

Didar

> I don't know if what I'm about to say has been documented and remedied.
> 
> I have noticed that allthough a file which is owned by root and group root
> and having permissions rw-r--r-- can be deleted by another user if it is
> in his home directory by using rm -f !
> I am using fileutils-4.0
> 
> I feel that this kind of behaviour is very contrary to common operation.
> 
> Didar

This is the normal UNIX filesystem behavior when the directory
containing the file is writable by the user removing the file.  The
reason is that files are contained in directories.  The permission on
the directory therefore permits or denies addition, removal or
renaming of files contained in that directory.  The read and write
permission on files govern only whether it is possible to read or
write them and not add, remove or rename them from a directory.  Also,
a single file may be contained in many different directories.
Removing it from one directory does not remove the file if there are
still references to it in other directories.

This behavior is controlled by the filesystem which is linked into the
operating system kernel and is not controllable by a user program such
as rm, mv, cp or other user space applications.  Those utility
programs can only do what the OS allows and cannot do anything that
the OS denies.

I agree this behavior can be contrary to what people new to unix would
commonly expect.  Other filesystems have been developed with different
and some think more intuitive behavior.  You might want to check out
AFS, the Andrew File System.  It has a permission structure which some
people find more desirable.  It does, however, have other
complexities.

  ftp://ftp.transarc.com/pub/afs-contrib/doc/faq/afs-faq.html
  http://www.angelfire.com/hi/plutonic/afs-faq.html

Bob



reply via email to

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