[lorax 2/2] Check if selinux is not in Enforcing mode (##824835)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Selinux causes problems for rpm scriptlets in the installroot.
---
 src/pylorax/__init__.py |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py
index 64924ce..44598d5 100644
--- a/src/pylorax/__init__.py
+++ b/src/pylorax/__init__.py
@@ -35,6 +35,7 @@ import os
 import ConfigParser
 import tempfile
 import locale
+import subprocess
 
 from base import BaseLoraxClass, DataHolder
 import output
@@ -160,6 +161,17 @@ class Lorax(BaseLoraxClass):
             logger.critical("no root privileges")
             sys.exit(1)
 
+        # is selinux disabled?
+        logger.info("checking the selinux mode")
+        try:
+            seoutput = subprocess.check_output("/sbin/getenforce").strip()
+        except subprocess.CalledProcessError:
+            logger.error("could not get the selinux mode")
+        else:
+            if seoutput == "Enforcing":
+                logger.critical("selinux must be disabled or in Permissive mode")
+                sys.exit(1)
+
         # do we have a proper yum base object?
         logger.info("checking yum base object")
         if not isinstance(ybo, yum.YumBase):
-- 
1.7.9.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux