Blame SOURCES/0008-Add-missing-SELinux-rule-for-ipa-custodia.sock_rhbz#1857157.patch

5144c6
From d83b760d1f76a3ba8e527dd27551e51a600b22c0 Mon Sep 17 00:00:00 2001
5144c6
From: Christian Heimes <cheimes@redhat.com>
5144c6
Date: Wed, 15 Jul 2020 10:23:35 +0200
5144c6
Subject: [PATCH] Add missing SELinux rule for ipa-custodia.sock
5144c6
5144c6
A SELinux rule for ipa_custodia_stream_connect(httpd_t) was not copied
5144c6
from upstream rules. It breaks installations on systems that don't have
5144c6
ipa_custodia_stream_connect in SELinux domain for apache, e.g. RHEL 8.3.
5144c6
5144c6
Fixes: https://pagure.io/freeipa/issue/8412
5144c6
Signed-off-by: Christian Heimes <cheimes@redhat.com>
5144c6
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
5144c6
---
5144c6
 selinux/ipa.te | 7 +++++++
5144c6
 1 file changed, 7 insertions(+)
5144c6
5144c6
diff --git a/selinux/ipa.te b/selinux/ipa.te
5144c6
index a3381217a4..c4c3fa805e 100644
5144c6
--- a/selinux/ipa.te
5144c6
+++ b/selinux/ipa.te
5144c6
@@ -378,6 +378,13 @@ optional_policy(`
5144c6
 	ipa_search_lib(ipa_custodia_t)
5144c6
 ')
5144c6
 
5144c6
+optional_policy(`
5144c6
+    gen_require(`
5144c6
+        type httpd_t;
5144c6
+    ')
5144c6
+    ipa_custodia_stream_connect(httpd_t)
5144c6
+')
5144c6
+
5144c6
 optional_policy(`
5144c6
 	pki_manage_tomcat_etc_rw(ipa_custodia_t)
5144c6
 	pki_read_tomcat_cert(ipa_custodia_t)