Check selinux state before creating output directory
This closes issue #163
This commit is contained in:
parent
1d32a0cb36
commit
dc348fac25
@ -34,6 +34,7 @@ import dnf.logging
|
|||||||
import librepo
|
import librepo
|
||||||
import pylorax
|
import pylorax
|
||||||
from pylorax.cmdline import lorax_parser
|
from pylorax.cmdline import lorax_parser
|
||||||
|
import selinux
|
||||||
|
|
||||||
def setup_logging(opts):
|
def setup_logging(opts):
|
||||||
pylorax.setup_logging(opts.logfile, log)
|
pylorax.setup_logging(opts.logfile, log)
|
||||||
@ -71,6 +72,11 @@ def main():
|
|||||||
|
|
||||||
setup_logging(opts)
|
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:
|
if not opts.workdir:
|
||||||
tempfile.tempdir = opts.tmp
|
tempfile.tempdir = opts.tmp
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user