[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: |
Jim Meyering |
Subject: |
bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so. |
Date: |
Wed, 05 Sep 2012 22:22:07 +0200 |
Jim Meyering wrote:
> Paul Eggert wrote:
>
>> On 09/05/2012 07:56 AM, Jim Meyering wrote:
>>> + /* When failing to rmdir an unreadable directory, the typical errno value
>>> + is EISDIR or ENOTDIR, but that would be meaningless in a diagnostic.
>>> + When that happens and the errno value from the failed open is EPERM
>>> + or EACCES, use the earlier, more descriptive errno value. */
>>> + if (ent->fts_info == FTS_DNR
>>> + && (errno == ENOTEMPTY || errno == EISDIR || errno == ENOTDIR)
>>> + && (ent->fts_errno == EPERM || ent->fts_errno == EACCES))
>>
>> Thanks for doing all that. I did notice that the code mentions
>> ENOTEMPTY but the comment doesn't -- is that intentional?
>
> Yes. I considered whether to remove explicit mention of those errno
> values in the comment for precisely that reason, but didn't bother.
> Good point. I've relaxed the comment wording enough to permit other
> explicit E* names:
>
> diff --git a/src/remove.c b/src/remove.c
> index 0c25462..a141718 100644
> --- a/src/remove.c
> +++ b/src/remove.c
> @@ -392,8 +392,8 @@ excise (FTS *fts, FTSENT *ent, struct rm_options const
> *x, bool is_dir)
> if (ignorable_missing (x, errno))
> return RM_OK;
>
> - /* When failing to rmdir an unreadable directory, the typical errno value
> - is EISDIR or ENOTDIR, but that would be meaningless in a diagnostic.
> + /* When failing to rmdir an unreadable directory, we see errno values
> + like EISDIR or ENOTDIR, but they would be meaningless in a diagnostic.
> When that happens and the errno value from the failed open is EPERM
> or EACCES, use the earlier, more descriptive errno value. */
> if (ent->fts_info == FTS_DNR
I've pushed the result:
http://git.sv.gnu.org/cgit/coreutils.git/commit/?id=ccbd3f3b290cb1bb
http://git.sv.gnu.org/cgit/coreutils.git/commit/?id=57dd06703cb89ba5
- 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/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
- 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
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Jim Meyering, 2012/09/08
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Jim Meyering, 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/05
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Paul Eggert, 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/05
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so.,
Jim Meyering <=
- 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., Linda Walsh, 2012/09/03
- bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it is documented to do so., Eric Blake, 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/04
bug#12339: [PATCH] rm: avoid bogus diagnostic for a slash-decorated symlink-to-dir, Linda A. Walsh, 2012/09/04