diff --git a/6bf108358a6104ec1c694c9530b3cd56b95f4b57.patch b/6bf108358a6104ec1c694c9530b3cd56b95f4b57.patch new file mode 100644 index 0000000000000000000000000000000000000000..a9bd81eaa143be54726c11e5b51e9b96c4cd1e04 --- /dev/null +++ b/6bf108358a6104ec1c694c9530b3cd56b95f4b57.patch @@ -0,0 +1,92 @@ +diff --git a/NEWS b/NEWS +index 79f5b0e99..d2cb9ae48 100644 +--- a/NEWS ++++ b/NEWS +@@ -20,6 +20,9 @@ GNU coreutils NEWS -*- outline -*- + ls no longer crashes when printing the SELinux context for unstatable files. + [bug introduced in coreutils-6.9.91] + ++ rm no longer skips an extra file when the removal of an empty directory fails. ++ [bug introduced by the rewrite to use fts in coreutils-8.0] ++ + tr no longer crashes when using --complement with certain + invalid combinations of case character classes. + [bug introduced in coreutils-8.6] +diff --git a/src/remove.c b/src/remove.c +index 2d40c55cd..adf948935 100644 +--- a/src/remove.c ++++ b/src/remove.c +@@ -506,7 +506,8 @@ rm_fts (FTS *fts, FTSENT *ent, struct rm_options const *x) + /* When we know (from prompt when in interactive mode) + that this is an empty directory, don't prompt twice. */ + s = excise (fts, ent, x, true); +- fts_skip_tree (fts, ent); ++ if (s == RM_OK) ++ fts_skip_tree (fts, ent); + } + + if (s != RM_OK) +diff --git a/tests/local.mk b/tests/local.mk +index e1c4675c2..297760cc5 100644 +--- a/tests/local.mk ++++ b/tests/local.mk +@@ -136,6 +136,7 @@ all_root_tests = \ + tests/rm/no-give-up.sh \ + tests/rm/one-file-system.sh \ + tests/rm/read-only.sh \ ++ tests/rm/empty-immutable-skip.sh \ + tests/tail-2/append-only.sh \ + tests/tail-2/end-of-device.sh \ + tests/touch/now-owned-by-other.sh +diff --git a/tests/rm/empty-immutable-skip.sh b/tests/rm/empty-immutable-skip.sh +new file mode 100755 +index 000000000..c91d8d412 +--- /dev/null ++++ b/tests/rm/empty-immutable-skip.sh +@@ -0,0 +1,46 @@ ++#!/bin/sh ++# Ensure that rm does not skip extra files after hitting an empty immutable dir. ++# Requires root access to do chattr +i, as well as an ext[23] or xfs file system ++ ++# Copyright (C) 2020 Free Software Foundation, Inc. ++ ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src ++print_ver_ rm ++require_root_ ++ ++# These simple one-file operations are expected to work even in the ++# presence of this bug, and we need them to set up the rest of the test. ++chattr_i_works=1 ++touch f ++chattr +i f 2>/dev/null || chattr_i_works=0 ++rm f 2>/dev/null ++test -f f || chattr_i_works=0 ++chattr -i f 2>/dev/null || chattr_i_works=0 ++rm f 2>/dev/null || chattr_i_works=0 ++test -f f && chattr_i_works=0 ++ ++if test $chattr_i_works = 0; then ++ skip_ "chattr +i doesn't work on this file system" ++fi ++ ++mkdir empty || framework_failure_ ++touch x y || framework_failure_ ++chattr +i empty || framework_failure_ ++rm -rf empty x y ++{ test -f x || test -f y; } && fail=1 ++chattr -i empty ++ ++Exit $fail diff --git a/coreutils.spec b/coreutils.spec index f5a08aa750f6eecebb0afdb66bc44e9d689578f4..2fc96ad0a62c5f953ea50b07128e0a9ceccb571b 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,6 +1,6 @@ Name: coreutils Version: 8.32 -Release: 2 +Release: 3 License: GPLv3+ Summary: A set of basic GNU tools commonly used in shell scripts Url: https://www.gnu.org/software/coreutils/ @@ -25,6 +25,7 @@ Patch8: skip-the-tests-that-require-selinux-if-selinux-is-di.patch Patch9: coreutils-8.32-ls-removed-dir.patch Patch10: coreutils-8.32-leaf-opt-xfs.patch +Patch6000: 6bf108358a6104ec1c694c9530b3cd56b95f4b57.patch Conflicts: filesystem < 3 # To avoid clobbering installs @@ -135,6 +136,9 @@ fi %{_mandir}/man*/* %changelog +* 20201127043007634347 patch-tracking 8.32-3 +- append patch file of upstream repository from <6bf108358a6104ec1c694c9530b3cd56b95f4b57> to <6bf108358a6104ec1c694c9530b3cd56b95f4b57> + * Wed Aug 26 2020 chenbo pan - 8.32-2 - fix patch error @@ -221,4 +225,4 @@ fi - reintroduce very old Provides (mktemp, sh-utils, textwrap, fileutils, stat) * Thu Jul 12 2018 hexiaowen - 8.30-1 -- Pacakge init +- Pacakge init \ No newline at end of file