chcon no longer aborts on a selinux disabled system(#527142)

This commit is contained in:
Ondrej Vasik 2009-10-05 07:06:38 +00:00
parent e87ead322a
commit fa0337b2a5
2 changed files with 16 additions and 1 deletions

View File

@ -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\ With --reference, change the security context of each FILE to that of RFILE.\n\
\n\ \n\
-h, --no-dereference affect symbolic links instead of any referenced file\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 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-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 +++ coreutils-7.1/src/id.c 2009-02-24 13:47:15.000000000 +0100

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils Name: coreutils
Version: 7.6 Version: 7.6
Release: 6%{?dist} Release: 7%{?dist}
License: GPLv3+ License: GPLv3+
Group: System Environment/Base Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/ Url: http://www.gnu.org/software/coreutils/
@ -333,6 +333,10 @@ fi
%{_libdir}/coreutils %{_libdir}/coreutils
%changelog %changelog
* Mon Oct 05 2009 Ondrej Vasik <ovasik@redhat.com> - 7.6-7
- chcon no longer aborts on a selinux disabled system
(#527142)
* Fri Oct 02 2009 Ondrej Vasik <ovasik@redhat.com> - 7.6-6 * Fri Oct 02 2009 Ondrej Vasik <ovasik@redhat.com> - 7.6-6
- ls -LR exits with status 2, not 0, when it encounters - ls -LR exits with status 2, not 0, when it encounters
a cycle(#525402) a cycle(#525402)