Restore selinux_fixup

This commit is contained in:
Lauri Võsandi 2021-04-12 14:22:25 +03:00
parent 447aa70035
commit a78b0f21ba

View File

@ -22,6 +22,16 @@ from datetime import datetime, timedelta
from oscrypto import asymmetric from oscrypto import asymmetric
from pinecrypt.client import const from pinecrypt.client import const
def selinux_fixup(path):
"""
Fix OpenVPN credential store security context on Fedora
"""
if os.path.exists("/usr/bin/chcon"):
cmd = "chcon", "--type=home_cert_t", path
subprocess.call(cmd)
class ConfigTreeParser(ConfigParser): class ConfigTreeParser(ConfigParser):
def __init__(self, path, *args, **kwargs): def __init__(self, path, *args, **kwargs):
ConfigParser.__init__(self, *args, **kwargs) ConfigParser.__init__(self, *args, **kwargs)