policycoreutils: gui: system-config-selinux: do not use lokkit

We should be able to make changed to /etc/selinux/config without using lokkit

Signed-off-by: Eric Paris <eparis@redhat.com>
Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
Dan Walsh 2012-12-06 14:40:23 -05:00 committed by Eric Paris
parent aa62cd60f7
commit 017d35aad4
1 changed files with 16 additions and 2 deletions

View File

@ -158,8 +158,22 @@ class statusPage:
self.enabled = enabled
def write_selinux_config(self, enforcing, type):
import commands
commands.getstatusoutput("/usr/sbin/lokkit --selinuxtype=%s --selinux=%s" % (type, enforcing))
path = selinux.selinux_path() + "config"
backup_path = path + ".bck"
fd = open(path)
lines = fd.readlines()
fd.close()
fd = open(backup_path, "w")
for l in lines:
if l.startswith("SELINUX="):
fd.write("SELINUX=%s\n" % enforcing)
continue
if l.startswith("SELINUXTYPE="):
fd.write("SELINUXTYPE=%s\n" % type)
continue
fd.write(l)
fd.close()
os.rename(backup_path, path)
def read_selinux_config(self):
self.initialtype = selinux.selinux_getpolicytype()[1]