8d0e4d
From 6880c3dc9098b3337612850d1500b474aeb944ca Mon Sep 17 00:00:00 2001
8d0e4d
From: Kamil Dudka <kdudka@redhat.com>
8d0e4d
Date: Tue, 29 Aug 2017 17:33:51 +0200
8d0e4d
Subject: [PATCH] require_selinux_(): use selinuxenabled(8) if available
8d0e4d
8d0e4d
---
8d0e4d
 init.cfg | 3 +++
8d0e4d
 1 file changed, 3 insertions(+)
8d0e4d
8d0e4d
diff --git a/init.cfg b/init.cfg
8d0e4d
index af6b581..f887b3a 100644
8d0e4d
--- a/init.cfg
8d0e4d
+++ b/init.cfg
8d0e4d
@@ -114,6 +114,9 @@ require_selinux_()
8d0e4d
   grep 'selinuxfs$' /proc/filesystems > /dev/null \
8d0e4d
     || skip_ "this system lacks SELinux support"
8d0e4d
 
8d0e4d
+  # use the 'selinuxenabled' utility if available
8d0e4d
+  selinuxenabled; [ $? = 1 ] && skip_ "SELinux is disabled"
8d0e4d
+
8d0e4d
   # Independent of whether SELinux is enabled system-wide,
8d0e4d
   # the current file system may lack SELinux support.
8d0e4d
   # Also the current build may have SELinux support disabled.
8d0e4d
-- 
8d0e4d
2.9.5
8d0e4d