lkml.org 
[lkml]   [1999]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectrmdir of one's pwd (was Re: rmdir of a busy directory)


On Fri, 12 Feb 1999, Ralf Corsepius wrote:

[snip rmdir . not failing on Linux]
> > You never tried 4.4BSD, right?
> True.
Arrghhh... Turns out that I also didn't.

$ mkdir foo
$ (cd foo; sleep 10) &
$ rmdir foo
$ mkdir bar
$ cd bar
$ rmdir .
rmdir: bar: Invalid argument
$ uname
FreeBSD
$

Sorry. From /sys/kern/vfs_syscalls.c it looks like FreeBSD explicitly
checks for "."... Hmm... OK, it's not a big deal. Sorry, I misparsed you,
assuming that you want -EBUSY on rmdir() back. So it's -EINVAL and for
completely different reasons... Fine.

--- fs/namei.c Tue Feb 9 10:17:15 1999
+++ fs/namei.c.new Fri Feb 12 07:46:04 1999
@@ -942,6 +942,9 @@
if (error)
return error;

+ if (dentry == current->fs->pwd)
+ return -EINVAL;
+
if (!dir->i_op || !dir->i_op->rmdir)
return -EPERM;

Linus, could you apply this patch? IMHO it makes sense - it
explicitly forbids rmdir of one's pwd. Current directory of anybody else
is still fair game.
Al


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

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.064 / U:1.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site