Re: rmdir of one's pwd (was Re: rmdir of a busy directory)

Janos Farkas (Janos.Farkas-nouce/priv-#HFaJFN8zd3f80JJgONKNb4.CYQC@lk9qw.mail.eon.ml.org)
Fri, 12 Feb 1999 21:40:07 +0100


[Linus and Andreas stripped from mass-Cc, they surely know about it.]

On 1999-02-12 at 09:49:14, Linus Torvalds wrote:
> On 12 Feb 1999, Andreas Schwab wrote:
> > This patch is wrong, it also forbids `rmdir ../foo'. Only a path ending
> > in '.' is special. Think about it: to find out the real name of the entry
> > to unlink you'll have find its link in the parent directory. With `.' you
> > simply don't have enough information about what to unlink.
>
> Actually, you do.
>
> _I_ think "." just means "current working directory".

For forgetful people, this is all well known, and discussed before, with
additional details, just look in any linux-kernel archive, and search
for the subject 'rmdir(".") works, and causes havoc'. One example is at:

http://www.uwsg.indiana.edu/hypermail/linux/kernel/9708.0/date.html

(Yup, about 18 months old.. Breaks my unreleased theory about each
dubious topic coming up 12 months later with a solution :)

There was a more serious bug then, but rmdir(".") is just interesting,
and nice, IMHO too. But as sct said, opendir(".") later on showing an
empty dir is not quite intuitive.

-- 
Janos - Don't worry, my address is real.  I'm just bored of spam.

- 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/