From 269a4a993f5b27007200b92372061c11a2508246 Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Mon, 23 Nov 2020 17:30:15 +0800 Subject: [PATCH 1/3] [patch tracking] 20201123173007634294 - https://github.com/coreutils/coreutils/commit/7b341f084bce94f4d67e0f65f6746130611b96d5 --- ...1f084bce94f4d67e0f65f6746130611b96d5.patch | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 7b341f084bce94f4d67e0f65f6746130611b96d5.patch diff --git a/7b341f084bce94f4d67e0f65f6746130611b96d5.patch b/7b341f084bce94f4d67e0f65f6746130611b96d5.patch new file mode 100644 index 0000000..c34072e --- /dev/null +++ b/7b341f084bce94f4d67e0f65f6746130611b96d5.patch @@ -0,0 +1,93 @@ +diff --git a/po/POTFILES.in b/po/POTFILES.in +index 5ccc0e9a9..074322393 100644 +--- a/po/POTFILES.in ++++ b/po/POTFILES.in +@@ -109,6 +109,7 @@ src/remove.c + src/rm.c + src/rmdir.c + src/runcon.c ++src/selinux.c + src/seq.c + src/set-fields.c + src/shred.c +diff --git a/src/selinux.c b/src/selinux.c +index 10fa9d8c6..50efb0aec 100644 +--- a/src/selinux.c ++++ b/src/selinux.c +@@ -21,7 +21,9 @@ + #include + #include + ++#include "die.h" + #include "system.h" ++#include "canonicalize.h" + #include "xfts.h" + #include "selinux.h" + +@@ -113,6 +115,16 @@ defaultcon (struct selabel_handle *selabel_handle, + context_t scontext = 0, tcontext = 0; + const char *contype; + char *constr; ++ char *newpath = NULL; ++ ++ if (! IS_ABSOLUTE_FILE_NAME (path)) ++ { ++ newpath = canonicalize_filename_mode (path, CAN_MISSING); ++ if (! newpath) ++ die (EXIT_FAILURE, errno, _("error canonicalizing %s"), ++ quoteaf (path)); ++ path = newpath; ++ } + + if (selabel_lookup (selabel_handle, &scon, path, mode) < 0) + { +@@ -120,7 +132,7 @@ defaultcon (struct selabel_handle *selabel_handle, + when processing files, when in fact it was the + associated default context that was not found. + Therefore map the error to something more appropriate +- to the context in which we're using matchpathcon(). */ ++ to the context in which we're using selabel_lookup(). */ + if (errno == ENOENT) + errno = ENODATA; + goto quit; +@@ -146,6 +158,7 @@ defaultcon (struct selabel_handle *selabel_handle, + context_free (tcontext); + freecon (scon); + freecon (tcon); ++ free (newpath); + return rc; + } + +@@ -269,8 +282,23 @@ bool + restorecon (struct selabel_handle *selabel_handle, + char const *path, bool recurse) + { ++ char *newpath = NULL; ++ ++ if (! IS_ABSOLUTE_FILE_NAME (path)) ++ { ++ newpath = canonicalize_filename_mode (path, CAN_MISSING); ++ if (! newpath) ++ die (EXIT_FAILURE, errno, _("error canonicalizing %s"), ++ quoteaf (path)); ++ path = newpath; ++ } ++ + if (! recurse) +- return restorecon_private (selabel_handle, path) == 0; ++ { ++ bool ok = restorecon_private (selabel_handle, path) != -1; ++ free (newpath); ++ return ok; ++ } + + char const *ftspath[2] = { path, NULL }; + FTS *fts = xfts_open ((char *const *) ftspath, FTS_PHYSICAL, NULL); +@@ -286,6 +314,7 @@ restorecon (struct selabel_handle *selabel_handle, + if (fts_close (fts) != 0) + err = errno; + ++ free (newpath); + return !err; + } + #endif -- Gitee From 22fc35d22b96b2252729819b4f397706fb898ecd Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Mon, 23 Nov 2020 17:30:16 +0800 Subject: [PATCH 2/3] [patch tracking] 20201123173007634294 - https://github.com/coreutils/coreutils/commit/b8a543fe024e79d4a927210b6700979129636054 --- ...43fe024e79d4a927210b6700979129636054.patch | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 b8a543fe024e79d4a927210b6700979129636054.patch diff --git a/b8a543fe024e79d4a927210b6700979129636054.patch b/b8a543fe024e79d4a927210b6700979129636054.patch new file mode 100644 index 0000000..d2abc88 --- /dev/null +++ b/b8a543fe024e79d4a927210b6700979129636054.patch @@ -0,0 +1,79 @@ +diff --git a/src/selinux.c b/src/selinux.c +index 50efb0aec..92b6b6b52 100644 +--- a/src/selinux.c ++++ b/src/selinux.c +@@ -21,7 +21,6 @@ + #include + #include + +-#include "die.h" + #include "system.h" + #include "canonicalize.h" + #include "xfts.h" +@@ -89,10 +88,12 @@ computecon (char const *path, mode_t mode, char **con) + goto quit; + rc = security_compute_create (scon, tcon, tclass, con); + +-quit: ++ quit:; ++ int err = errno; + free (dir); + freecon (scon); + freecon (tcon); ++ errno = err; + return rc; + } + +@@ -119,10 +120,10 @@ defaultcon (struct selabel_handle *selabel_handle, + + if (! IS_ABSOLUTE_FILE_NAME (path)) + { ++ /* Generate absolute name as required by subsequent selabel_lookup. */ + newpath = canonicalize_filename_mode (path, CAN_MISSING); + if (! newpath) +- die (EXIT_FAILURE, errno, _("error canonicalizing %s"), +- quoteaf (path)); ++ goto quit; + path = newpath; + } + +@@ -153,12 +154,14 @@ defaultcon (struct selabel_handle *selabel_handle, + + rc = setfscreatecon (constr); + +-quit: ++ quit:; ++ int err = errno; + context_free (scontext); + context_free (tcontext); + freecon (scon); + freecon (tcon); + free (newpath); ++ errno = err; + return rc; + } + +@@ -286,17 +289,21 @@ restorecon (struct selabel_handle *selabel_handle, + + if (! IS_ABSOLUTE_FILE_NAME (path)) + { ++ /* Generate absolute name as required by subsequent selabel_lookup. ++ When RECURSE, this also generates absolute names in the ++ fts entries, which may be quicker to process in any case. */ + newpath = canonicalize_filename_mode (path, CAN_MISSING); + if (! newpath) +- die (EXIT_FAILURE, errno, _("error canonicalizing %s"), +- quoteaf (path)); ++ return false; + path = newpath; + } + + if (! recurse) + { + bool ok = restorecon_private (selabel_handle, path) != -1; ++ int err = errno; + free (newpath); ++ errno = err; + return ok; + } + -- Gitee From 85b21e6f603b413b2bae2c46a811b74044691092 Mon Sep 17 00:00:00 2001 From: openeuler-ci-bot <80474298@qq.com> Date: Mon, 23 Nov 2020 17:30:17 +0800 Subject: [PATCH 3/3] [patch tracking] 20201123173007634294 - update spec file --- coreutils.spec | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/coreutils.spec b/coreutils.spec index f5a08aa..3fd706b 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,8 @@ 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: 7b341f084bce94f4d67e0f65f6746130611b96d5.patch +Patch6001: b8a543fe024e79d4a927210b6700979129636054.patch Conflicts: filesystem < 3 # To avoid clobbering installs @@ -135,6 +137,9 @@ fi %{_mandir}/man*/* %changelog +* 20201123173007634294 patch-tracking 8.32-3 +- append patch file of upstream repository from <7b341f084bce94f4d67e0f65f6746130611b96d5> to + * Wed Aug 26 2020 chenbo pan - 8.32-2 - fix patch error @@ -221,4 +226,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 -- Gitee