lkml.org 
[lkml]   [1999]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: rmdir of one's pwd (was Re: rmdir of a busy directory)
    From
    Date
    Linus Torvalds <torvalds@transmeta.com> writes:

    |> On 12 Feb 1999, Andreas Schwab wrote:
    |>
    |> > |> + if (dentry == current->fs->pwd)
    |> > |> + return -EINVAL;
    |> > |> +
    |> > |> if (!dir->i_op || !dir->i_op->rmdir)
    |> > |> return -EPERM;
    |> >
    |> > 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.

    Yes. I should have added `except when you have Linux' clever dentries'.

    |> Show me POSIX or other standards that say that you can't do it, and I
    |> guess I have to work around a standards problem, but right now I say that
    |> if programs ask for 'rmdir(".")', then they had better get it. I don't
    |> think the OS should second-guess anybody.

    I agree with that. IMHO the fixinc script should be fixed.

    Andreas.

    --
    Andreas Schwab "And now for something
    schwab@issan.cs.uni-dortmund.de completely different"
    schwab@gnu.org

    -
    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.020 / U:2.424 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site