Check selinux state before creating output directory

This closes issue #163
This commit is contained in:
Brian C. Lane 2018-04-26 11:12:24 -07:00
parent 1d32a0cb36
commit dc348fac25
1 changed files with 6 additions and 0 deletions

View File

@ -34,6 +34,7 @@ import dnf.logging
import librepo
import pylorax
from pylorax.cmdline import lorax_parser
import selinux
def setup_logging(opts):
pylorax.setup_logging(opts.logfile, log)
@ -71,6 +72,11 @@ def main():
setup_logging(opts)
log.info("checking the selinux mode")
if selinux.is_selinux_enabled() and selinux.security_getenforce():
log.critical("selinux must be disabled or in Permissive mode")
sys.exit(1)
if not opts.workdir:
tempfile.tempdir = opts.tmp