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: 49b4a057f1 (Create missing
            /etc/httpd/alias for ipasession.key)

Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
Thomas Woerner
2018-08-02 11:22:55 +02:00
parent 6414509343
commit f751697924

View File

@@ -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(