From 216b33e49afa0165502a7b8b65e3181faaefc173 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 07 2020 09:15:24 +0000 Subject: import coreutils-8.30-6.el8_1.1 --- diff --git a/SOURCES/coreutils-8.30-chcon-invalid-context.patch b/SOURCES/coreutils-8.30-chcon-invalid-context.patch new file mode 100644 index 0000000..96a38f6 --- /dev/null +++ b/SOURCES/coreutils-8.30-chcon-invalid-context.patch @@ -0,0 +1,42 @@ +From 5d6c2c9b3869938592025ce169659f0c7e9970fc Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Mon, 2 Dec 2019 14:02:02 +0100 +Subject: [PATCH] chcon: do not validate security context if SELinux is + disabled + +* src/chcon.c (main): Skip call of security_check_context() +in case SELinux is disabled to avoid unnecessary failure. + +Bug: https://bugzilla.redhat.com/1777831 + +Upstream-commit: 5118a2e392c8cffb3c26eaffbb75e2b1ef7607f9 +Signed-off-by: Kamil Dudka +--- + src/chcon.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/chcon.c b/src/chcon.c +index 6414406..eea4235 100644 +--- a/src/chcon.c ++++ b/src/chcon.c +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + #include "system.h" + #include "dev-ino.h" +@@ -557,7 +558,8 @@ main (int argc, char **argv) + else + { + specified_context = argv[optind++]; +- if (security_check_context (se_const (specified_context)) < 0) ++ if (0 < is_selinux_enabled () ++ && security_check_context (se_const (specified_context)) < 0) + die (EXIT_FAILURE, errno, _("invalid context: %s"), + quote (specified_context)); + } +-- +2.21.1 + diff --git a/SPECS/coreutils.spec b/SPECS/coreutils.spec index 8bcdecf..56108b2 100644 --- a/SPECS/coreutils.spec +++ b/SPECS/coreutils.spec @@ -1,7 +1,7 @@ Summary: A set of basic GNU tools commonly used in shell scripts Name: coreutils Version: 8.30 -Release: 6%{?dist} +Release: 6%{?dist}.1 License: GPLv3+ Group: System Environment/Base Url: https://www.gnu.org/software/coreutils/ @@ -26,6 +26,9 @@ Patch3: coreutils-8.30-fsync-fallback.patch # cp --preserve=xattr: preserve NFSv4 ACL extended attributes (#1646985) Patch4: coreutils-8.30-cp-preserve-xattr-NFSv4-ACL.patch +# chcon: do not validate security context if SELinux is disabled (#1777831) +Patch5: coreutils-8.30-chcon-invalid-context.patch + # disable the test-lock gnulib test prone to deadlock Patch100: coreutils-8.26-test-lock.patch @@ -261,6 +264,9 @@ fi %license COPYING %changelog +* Wed Jan 29 2020 Kamil Dudka - 8.30-6.el8_1.1 +- chcon: do not validate security context if SELinux is disabled (#1777831) + * Fri Jan 11 2019 Kamil Dudka - 8.30-6 - cp --preserve=xattr: preserve NFSv4 ACL extended attributes (#1646985)