Re: [PATCH]Fix bug:rmdir could remove current working directory

From: Mingming cao (cmm@us.ibm.com)
Date: Wed Oct 10 2001 - 20:03:56 EST


Alexander Viro wrote:
>
> On Wed, 10 Oct 2001, Mingming cao wrote:
>
> > Hi Linus, Alan and Al,
> >
> > I found that rmdir(2) could remove current working directory
> > successfully. This happens when the given pathname points to current
> > working directory, not ".", but something else. For example, the current
> > working directory's absolute pathname. I read the man page of
> > rmdir(2). It says in this case EBUSY error should be returned. I
> > suspected this is a bug and added a check in vfs_rmdir(). The following
> > patch is against 2.4.10 and has been verified. Please comment and
> > apply.
>
> It's not a bug. Moreover, test you add is obviously bogus - what about
> cwd of other processes?
>
> Actually, rmdir() on a busy directory _is_ OK. Implementation is allowed
> to refuse doing that, but it's not required to.

I thought about the case when rmdir() on the cwd of other processes,
but, as you said, that is implementation dependent. However rmdir() on
"." does returns EBUSY error. Should not we keep the rmdir() behavior
consistent: rmdir() on the current working directory of the current
process is not OK?

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



This archive was generated by hypermail 2b29 : Mon Oct 15 2001 - 21:00:35 EST