From f7516979241ed80a48250784051a82457e2df7aa Mon Sep 17 00:00:00 2001 From: Thomas Woerner Date: Thu, 2 Aug 2018 11:22:55 +0200 Subject: [PATCH] httpinstance: Restore SELinux context of session_dir /etc/httpd/alias The session directory /etc/httpd/alias/ could be created with the wrong SELinux context. Therefore httpd was not able to write to this directory. Fixes: https://pagure.io/freeipa/issue/7662 Related-to: 49b4a057f1b0459331bcec2c8d760627d00e4571 (Create missing /etc/httpd/alias for ipasession.key) Reviewed-By: Christian Heimes --- ipaserver/install/httpinstance.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ipaserver/install/httpinstance.py b/ipaserver/install/httpinstance.py index 62b563fb2..1b1e7a03d 100644 --- a/ipaserver/install/httpinstance.py +++ b/ipaserver/install/httpinstance.py @@ -183,6 +183,9 @@ class HTTPInstance(service.Service): os.makedirs(session_dir) # Must be world-readable / executable os.chmod(session_dir, 0o755) + # Restore SELinux context of session_dir /etc/httpd/alias, see + # https://pagure.io/freeipa/issue/7662 + tasks.restore_context(session_dir) target_fname = paths.HTTPD_IPA_CONF http_txt = ipautil.template_file(