[BUG] directory renaming/removal

From: David Howells (dhowells@cambridge.redhat.com)
Date: Fri Feb 02 2001 - 08:28:28 EST

Run the following script (It's been tried on linux-2.2.x and linux-2.4.x):

cd /tmp
mkdir x
cd x
mkdir x y z
strace -etrace=rename,mkdir,rmdir,chmod mv x z
echo ---------
chmod -w y
strace -etrace=rename,mkdir,rmdir,chmod mv y z

The output:

rename("x", "z/x") = 0
rename("y", "z/y") = -1 EACCES (Permission denied)
mkdir("z/y", 040755) = 0
chmod("z/y", 040555) = 0
rmdir("y") = 0

You'll notice the following:

 (1) Linux can't rename directories that are marked as read-only. This is
     strange because the directories actually being modified _do_ have write

 (2) You can _remove_ a read-only directory.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

This archive was generated by hypermail 2b29 : Wed Feb 07 2001 - 21:00:15 EST