bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug: Symlink removal.


From: Jim Meyering
Subject: Re: Bug: Symlink removal.
Date: Thu, 20 Mar 2003 13:50:21 +0100

Thank you for the report.

Here's some previous discussion on the matter:

  http://mail.gnu.org/archive/html/bug-fileutils/2003-01/msg00006.html

rm fails to remove a symlink specified with a trailing slash
because the unlink syscall also fails for such an argument.

Making rm detect that condition earlier would not be hard,
but would incur some cost -- cost to be borne by non-failing uses
of rm.  You might want to incur the cost only when prompting
the user, but then that'd make rm behave differently with -i
than without.

The reason it used to work is because older versions of rm (prior
to the rewrite for fileutils-4.1.9) improperly removed any trailing
slashes.  POSIX prohibits that.

I admit that the diagnostics are contradictory,
and I may well fix that some day, but it's not a high priority.

Seemant Kulleen <address@hidden> wrote:
> Currently in gentoo, we offer fileutils-4.1.11 and coreutils-4.5.10 (which is 
> currently masked for testing, and we are ready to replace the 3 utils with 
> coreutils, as soon as it goes stable according to GNU).
>
> The problem is a slight modification of one reported here:
>
> http://mail.gnu.org/archive/html/bug-fileutils/2003-01/msg00002.html
>
> Now, the results are as follows:
>
> address@hidden temp $ mkdir test
> address@hidden temp $ touch test/testfile
> address@hidden temp $ ln -s test test2
> address@hidden temp $ rm test2/
> rm: remove directory `test2/'? y
> rm: cannot remove directory `test2/': Is a directory
> address@hidden temp $ rmdir test2/
> rmdir: `test2/': Not a directory
> address@hidden temp $ rm test2/
> rm: remove directory `test2/'? y
> rm: cannot remove directory `test2/': Is a directory
> address@hidden temp $ rm test2
> rm: remove symbolic link `test2'? y
>
> What gives? is it a directory or isn't it? :P
>
> Note, that a user pointed my attention to this in gentoo's bugzilla:
>
> http://bugs.gentoo.org/show_bug.cgi?id=17838




reply via email to

[Prev in Thread] Current Thread [Next in Thread]