From a78b0f21ba75db86dce7b261216a15ae54c391bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauri=20V=C3=B5sandi?= Date: Mon, 12 Apr 2021 14:22:25 +0300 Subject: [PATCH] Restore selinux_fixup --- pinecrypt/client/cli.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pinecrypt/client/cli.py b/pinecrypt/client/cli.py index dbdf1ab..10a726c 100644 --- a/pinecrypt/client/cli.py +++ b/pinecrypt/client/cli.py @@ -22,6 +22,16 @@ from datetime import datetime, timedelta from oscrypto import asymmetric 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): def __init__(self, path, *args, **kwargs): ConfigParser.__init__(self, *args, **kwargs)