[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is docu
From: |
Bernhard Voelker |
Subject: |
bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so. |
Date: |
Tue, 04 Sep 2012 16:28:47 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0 |
On 09/04/2012 02:55 PM, Jim Meyering wrote:
> With the following patch, I see new behavior.
> It's an improvement, but we're still not there:
>
> $ mkdir -p d/e/f; ln -s d s; rm -r s/
> rm: cannot remove 's/': Not a directory
> [Exit 1]
> $ find
> .
> ./s
> ./d
>
> Notice how it did traverse s/ into d/, and removed d/e and d/e/f.
> The only problem is that when it attempted to remove the command-line
> specified "s/", unlinkat (AT_FDCWD, "s/", AT_REMOVEDIR) failed:
>
> unlinkat(4, "d", 0) = 0
> unlinkat(5, "f", AT_REMOVEDIR) = 0
> unlinkat(4, "e", AT_REMOVEDIR) = 0
> unlinkat(AT_FDCWD, "s/", AT_REMOVEDIR) = -1 ENOTDIR (Not a directory)
> rm: cannot remove 's/': Not a directory
> +++ exited with 1 +++
>
> Now, this looks like a problem with unlinkat.
Hmm, what about dereferencing command line symlinks with trailing
slashes _before_ entering the FTS loop instead?
Have a nice day,
Berny
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., (continued)
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Linda Walsh, 2012/09/03
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Andreas Schwab, 2012/09/03
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Voelker, Bernhard, 2012/09/03
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Paul Eggert, 2012/09/03
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Bernhard Voelker, 2012/09/04
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Paul Eggert, 2012/09/04
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Jim Meyering, 2012/09/04
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Bernhard Voelker, 2012/09/04
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Jim Meyering, 2012/09/04
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.,
Bernhard Voelker <=
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Jim Meyering, 2012/09/04
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Paul Eggert, 2012/09/04
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Linda Walsh, 2012/09/05
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Jim Meyering, 2012/09/06
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Linda Walsh, 2012/09/06
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Jim Meyering, 2012/09/06
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Bob Proulx, 2012/09/06
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Linda Walsh, 2012/09/07
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Eric Blake, 2012/09/07
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Linda Walsh, 2012/09/07