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

Re: [lorax] Check if selinux is enabled before getting the mode



On 06/05/2012 07:26 AM, Martin Gracik wrote:
---
  src/pylorax/__init__.py |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py
index aeb1b02..25cccb3 100644
--- a/src/pylorax/__init__.py
+++ b/src/pylorax/__init__.py
@@ -181,7 +181,7 @@ class Lorax(BaseLoraxClass):
          # tools need to access (/etc/group, /etc/passwd, /etc/shadow etc.),
          # is wrong and selinux therefore disallows access to these files.
          logger.info("checking the selinux mode")
-        if selinux.security_getenforce():
+        if selinux.is_selinux_enabled() and selinux.security_getenforce():
              logger.critical("selinux must be disabled or in Permissive mode")
              sys.exit(1)


Ack

--
Jesse Keating
Fedora -- FreedomĀ² is a feature!


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