[lkml]   [2000]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [BUG] Inconsistent behaviour of rmdir

    On Thu, 16 Nov 2000, Jean-Marc Saffroy wrote:
    > As you see, it looks like the rmdir fails simply because the dir name ends
    > with a dot !! This is confirmed by sys_rmdir in fs/namei.c, around line
    > 1384 :
    > switch(nd.last_type) {
    > case LAST_DOTDOT:
    > error = -ENOTEMPTY;
    > goto exit1;
    > case LAST_ROOT: case LAST_DOT:
    > error = -EBUSY;
    > goto exit1;
    > }
    > Should we rip off the offending "case LAST_DOT" ? Or do we need a smarter
    > patch ? Is it really a problem that a process has its current directory
    > deleted ? How about the root ?

    The cwd is not the problem. The '.' is.

    The reason for that check is that allowing "rmdir(".")" confuses a lot of
    UNIX programs, because it wasn't traditionally allowed.

    > The man page for rmdir(2) should be updated as well, the current one
    > states :
    > EBUSY pathname is the current working directory or root
    > directory of some process.

    That's definitely wrong. You can do

    rmdir `pwd`

    and that's fine (not all filesystems will let you do that, but that's a
    low-level filesystem issue). It's really only the special names "." and
    ".." that cannot be removed.


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 12:47    [W:0.035 / U:4.500 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site