More specific SELinux detection

This commit is contained in:
Lauri Võsandi 2021-04-23 14:06:48 +03:00
parent 450e68c946
commit 9db70b1a01

View File

@ -28,7 +28,7 @@ def selinux_fixup(path):
"""
Fix OpenVPN credential store security context on Fedora
"""
if os.path.exists("/usr/bin/chcon"):
if os.path.exists("/usr/bin/chcon") and os.path.exists("/sys/fs/selinux"):
cmd = "chcon", "--type=home_cert_t", path
subprocess.call(cmd)