]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
chcon: don't disable just because SELinux is disabled
authorJim Meyering <meyering@redhat.com>
Wed, 7 Oct 2009 13:31:17 +0000 (15:31 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 9 Oct 2009 12:33:10 +0000 (14:33 +0200)
* src/chcon.c (main): Now that gnulib provides getfilecon wrappers,
we can revert most of the 2009-10-05 commit 3a97d664, "chcon: exit
immediately if SELinux is disabled", since chcon is still useful as
long as the file system provides handlers for the security.*
name space.  gnulib's getfilecon wrappers ensure that an offending
context now evokes a return value of -1.
Prompted by comments from Stephen Smalley in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/18378/focus=18394
* NEWS (Bug fixes): Mention it.

NEWS
src/chcon.c

diff --git a/NEWS b/NEWS
index 75a4207adecbcf7668dc9c61ac90c39a02dedeca..f8269fccd322831dd7651c22cfe4658b213c5955 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,10 @@ GNU coreutils NEWS                                    -*- outline -*-
 
 ** Bug fixes
 
+  chcon no longer exits immediately just because SELinux is disabled.
+  Even then, chcon may still be useful.
+  [bug introduced in coreutils-8.0]
+
   stat -f recognizes more file system types: afs, cifs, anon-inode FS,
   btrfs, cgroupfs, cramfs-wend, debugfs, futexfs, hfs, inotifyfs, minux3,
   nilfs, securityfs, selinux, xenfs
index c0da6949a74bcbe1675fe3ceb0517e571ed6104f..fbfdb4d297e85c1f4fe14db88d90f54e959f8339 100644 (file)
@@ -519,10 +519,6 @@ 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)