From 0123377d9b95659c982fde2caccc82abec7bb488 Mon Sep 17 00:00:00 2001 From: Martin Gracik Date: Tue, 5 Jun 2012 16:25:53 +0200 Subject: [PATCH] Check if selinux is enabled before getting the mode --- 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 aeb1b020..25cccb34 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)