diff options
author | Jeremy Katz <katzj@redhat.com> | 2004-04-13 22:39:49 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2004-04-13 22:39:49 +0000 |
commit | 07d25b40fa2041439795595115a703e4f00a1a7d (patch) | |
tree | f7e3fef1ca008c110ecc5dcf5cc62c4de7dd9497 /flags.py | |
parent | 4a7602c7d19f62a331f4e578ace4898ad1157ce8 (diff) | |
download | anaconda-07d25b40fa2041439795595115a703e4f00a1a7d.tar.gz anaconda-07d25b40fa2041439795595115a703e4f00a1a7d.tar.xz anaconda-07d25b40fa2041439795595115a703e4f00a1a7d.zip |
New Improved SELinux handling
* default in constants.py
* 'selinux' flag will key it on (if off by default)
* turn on for selinux=1, off for selinux=0
* non-existence of selinuxfs will force off
Diffstat (limited to 'flags.py')
-rw-r--r-- | flags.py | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -12,6 +12,7 @@ # import os +from constants import * # A lot of effort, but it only allows a limited set of flags to be referenced class Flags: @@ -37,16 +38,26 @@ class Flags: self.__dict__['flags']['autostep'] = 0 self.__dict__['flags']['autoscreenshot'] = 0 self.__dict__['flags']['usevnc'] = 0 - self.__dict__['flags']['selinux'] = 0 + self.__dict__['flags']['selinux'] = SELINUX_DEFAULT # determine if selinux is enabled or not f = open("/proc/cmdline", "r") line = f.readline() f.close() - if os.path.exists("/selinux/load") and line.find(" selinux=0") == -1: - self.__dict__['flags']['selinux'] = 1 - + tokens = line.split() + for tok in tokens: + if tok == "selinux": + self.__dict__['flags']['selinux'] = 1 + elif tok == "selinux=0": + self.__dict__['flags']['selinux'] = 0 + elif tok == "selinux=1": + self.__dict__['flags']['selinux'] = 1 + + if not os.path.exists("/selinux/load"): + self.__dict__['flags']['selinux'] = 0 + + global flags flags = Flags() |