From fa0337b2a5bbd73e618d098c678230adb7e2c16b Mon Sep 17 00:00:00 2001 From: Ondrej Vasik Date: Mon, 5 Oct 2009 07:06:38 +0000 Subject: [PATCH] chcon no longer aborts on a selinux disabled system(#527142) --- coreutils-selinux.patch | 11 +++++++++++ coreutils.spec | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/coreutils-selinux.patch b/coreutils-selinux.patch index 233af56..162a87b 100644 --- a/coreutils-selinux.patch +++ b/coreutils-selinux.patch @@ -162,6 +162,17 @@ diff -urNp coreutils-7.1-orig/src/chcon.c coreutils-7.1/src/chcon.c With --reference, change the security context of each FILE to that of RFILE.\n\ \n\ -h, --no-dereference affect symbolic links instead of any referenced file\n\ +@@ -519,6 +519,10 @@ main (int argc, char **argv) + usage (EXIT_FAILURE); + } + ++ if (is_selinux_enabled () != 1) ++ error (EXIT_FAILURE, 0, ++ _("%s may be used only on a SELinux kernel"), program_name); ++ + if (reference_file) + { + if (getfilecon (reference_file, &ref_context) < 0) diff -urNp coreutils-7.1-orig/src/id.c coreutils-7.1/src/id.c --- coreutils-7.1-orig/src/id.c 2009-02-16 15:57:44.000000000 +0100 +++ coreutils-7.1/src/id.c 2009-02-24 13:47:15.000000000 +0100 diff --git a/coreutils.spec b/coreutils.spec index 4eedeb4..4a5e061 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,7 +1,7 @@ Summary: A set of basic GNU tools commonly used in shell scripts Name: coreutils Version: 7.6 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv3+ Group: System Environment/Base Url: http://www.gnu.org/software/coreutils/ @@ -333,6 +333,10 @@ fi %{_libdir}/coreutils %changelog +* Mon Oct 05 2009 Ondrej Vasik - 7.6-7 +- chcon no longer aborts on a selinux disabled system + (#527142) + * Fri Oct 02 2009 Ondrej Vasik - 7.6-6 - ls -LR exits with status 2, not 0, when it encounters a cycle(#525402)