Makefile | 2 +-
imgcreate/kickstart.py | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
New commits:
commit e0833c839b697b1bfd878b891446f7b4c62f3d7d
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Jul 23 14:17:25 2014 -0700
Version 21.2
diff --git a/Makefile b/Makefile
index 74e64e1..78de9cf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 21.1
+VERSION = 21.2
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit 629a3ed4c5327615b841cc2e55e5c2806b6edfa5
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Jul 23 12:27:05 2014 -0700
Abort livecd creation if selinux relabel fails (#1121301)
This will Help catch selinux errors sooner. If the kickstart has selinux
enforcing set and the relabel fails raise an error. If it is in
permissive or disabled it will only warn.
diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
index 14ddb4e..aef3ef2 100644
--- a/imgcreate/kickstart.py
+++ b/imgcreate/kickstart.py
@@ -121,7 +121,7 @@ class KickstartConfig(object):
def call(self, args):
if not os.path.exists("%s/%s" %(self.instroot, args[0])):
raise errors.KickstartError("Unable to run %s!" %(args))
- subprocess.call(args, preexec_fn = self.chroot)
+ return subprocess.call(args, preexec_fn = self.chroot)
def apply(self):
pass
@@ -450,7 +450,12 @@ class SelinuxConfig(KickstartConfig):
if not os.path.exists(self.path("/sbin/setfiles")):
return
- self.call(["/sbin/setfiles", "-p", "-e", "/proc", "-e", "/sys", "-e", "/dev", selinux.selinux_file_context_path(), "/"])
+ rc = self.call(["/sbin/setfiles", "-p", "-e", "/proc", "-e", "/sys", "-e", "/dev", selinux.selinux_file_context_path(), "/"])
+ if rc:
+ if ksselinux.selinux == ksconstants.SELINUX_ENFORCING:
+ raise errors.KickstartError("SELinux relabel failed.")
+ else:
+ logging.error("SELinux relabel failed.")
def apply(self, ksselinux):
selinux_config = "/etc/selinux/config"