From 8f969a5929e8a2f54fd732ea0c8d0a4931250d23 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Thu, 1 Aug 2019 10:08:36 +0300 Subject: [PATCH] Restore SELinux context for p11-kit config overrides When 74e09087 started disabling softshm2 module in p11-kit-proxy, we missed to restore SELinux context on the configuration override creation. We don't need an explicit restore_context() when removing the override because restore_file() already calls restore_context(). Related: https://pagure.io/freeipa/issue/7810 Signed-off-by: Alexander Bokovoy Reviewed-By: Christian Heimes Reviewed-By: Rob Crittenden --- ipaplatform/redhat/tasks.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ipaplatform/redhat/tasks.py b/ipaplatform/redhat/tasks.py index e3c316c61..be0b6414a 100644 --- a/ipaplatform/redhat/tasks.py +++ b/ipaplatform/redhat/tasks.py @@ -717,6 +717,7 @@ class RedHatTaskNamespace(BaseTaskNamespace): # see man(5) pkcs11.conf f.write("disable-in: {}\n".format(", ".join(disabled_in))) os.fchmod(f.fileno(), 0o644) + self.restore_context(filename) logger.debug("Created PKCS#11 module config '%s'.", filename) filenames.append(filename)