Blame SOURCES/0001-RHEL-only-Add-cockpit-by-default-to-some-zones.patch

47f735
From 87ecae78c07da6db1faa18504b06345ab3ba51a0 Mon Sep 17 00:00:00 2001
7d5a1d
From: Eric Garver <e@erig.me>
7d5a1d
Date: Mon, 9 Jul 2018 11:29:33 -0400
47f735
Subject: [PATCH 01/22] RHEL only: Add cockpit by default to some zones
7d5a1d
7d5a1d
Fixes: #1581578
7d5a1d
---
47f735
 config/zones/home.xml     |  1 +
47f735
 config/zones/internal.xml |  1 +
47f735
 config/zones/public.xml   |  1 +
47f735
 config/zones/work.xml     |  1 +
47f735
 src/tests/functions.at    | 19 +++++++++++++++++++
47f735
 5 files changed, 23 insertions(+)
7d5a1d
7d5a1d
diff --git a/config/zones/home.xml b/config/zones/home.xml
7d5a1d
index 42b29b2f2d50..8aa8afa0e8aa 100644
7d5a1d
--- a/config/zones/home.xml
7d5a1d
+++ b/config/zones/home.xml
7d5a1d
@@ -6,4 +6,5 @@
7d5a1d
   <service name="mdns"/>
7d5a1d
   <service name="samba-client"/>
7d5a1d
   <service name="dhcpv6-client"/>
7d5a1d
+  <service name="cockpit"/>
7d5a1d
 </zone>
7d5a1d
diff --git a/config/zones/internal.xml b/config/zones/internal.xml
7d5a1d
index e646b48c94e8..40cb7e14424b 100644
7d5a1d
--- a/config/zones/internal.xml
7d5a1d
+++ b/config/zones/internal.xml
7d5a1d
@@ -6,4 +6,5 @@
7d5a1d
   <service name="mdns"/>
7d5a1d
   <service name="samba-client"/>
7d5a1d
   <service name="dhcpv6-client"/>
7d5a1d
+  <service name="cockpit"/>
7d5a1d
 </zone>
7d5a1d
diff --git a/config/zones/public.xml b/config/zones/public.xml
7d5a1d
index 49795d8c9068..617e131a4895 100644
7d5a1d
--- a/config/zones/public.xml
7d5a1d
+++ b/config/zones/public.xml
7d5a1d
@@ -4,4 +4,5 @@
7d5a1d
   <description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
7d5a1d
   <service name="ssh"/>
7d5a1d
   <service name="dhcpv6-client"/>
7d5a1d
+  <service name="cockpit"/>
7d5a1d
 </zone>
7d5a1d
diff --git a/config/zones/work.xml b/config/zones/work.xml
7d5a1d
index 6ea5550a40bd..9609ee6f65c2 100644
7d5a1d
--- a/config/zones/work.xml
7d5a1d
+++ b/config/zones/work.xml
7d5a1d
@@ -4,4 +4,5 @@
7d5a1d
   <description>For use in work areas. You mostly trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
7d5a1d
   <service name="ssh"/>
7d5a1d
   <service name="dhcpv6-client"/>
7d5a1d
+  <service name="cockpit"/>
7d5a1d
 </zone>
47f735
diff --git a/src/tests/functions.at b/src/tests/functions.at
47f735
index 582fdcc19314..6b1263b178dc 100644
47f735
--- a/src/tests/functions.at
47f735
+++ b/src/tests/functions.at
47f735
@@ -105,6 +105,13 @@ m4_define([FWD_START_TEST], [
e4e66d
 
47f735
     m4_ifdef([TESTING_FIREWALL_OFFLINE_CMD], [
47f735
         AT_KEYWORDS(offline)
47f735
+        dnl cockpit is added by default downstream, but upstream tests don't expect
47f735
+        dnl it. Simply remove it at the start of every test.
47f735
+        dnl
47f735
+        FWD_OFFLINE_CHECK([--zone home --remove-service-from-zone cockpit], 0, [ignore])
47f735
+        FWD_OFFLINE_CHECK([--zone internal --remove-service-from-zone cockpit], 0, [ignore])
47f735
+        FWD_OFFLINE_CHECK([--zone public --remove-service-from-zone cockpit], 0, [ignore])
47f735
+        FWD_OFFLINE_CHECK([--zone work --remove-service-from-zone cockpit], 0, [ignore])
47f735
     ], [
47f735
         m4_define_default([FIREWALL_BACKEND], [nftables])
e4e66d
 
47f735
@@ -226,6 +233,18 @@ m4_define([FWD_START_TEST], [
47f735
         ])
e4e66d
 
47f735
         FWD_START_FIREWALLD
47f735
+
47f735
+        dnl cockpit is added by default downstream, but upstream tests don't expect
47f735
+        dnl it. Simply remove it at the start of every test.
47f735
+        dnl
47f735
+        FWD_CHECK([--permanent --zone home --remove-service cockpit], 0, [ignore])
47f735
+        FWD_CHECK([            --zone home --remove-service cockpit], 0, [ignore])
47f735
+        FWD_CHECK([--permanent --zone internal --remove-service cockpit], 0, [ignore])
47f735
+        FWD_CHECK([            --zone internal --remove-service cockpit], 0, [ignore])
47f735
+        FWD_CHECK([--permanent --zone public --remove-service cockpit], 0, [ignore])
47f735
+        FWD_CHECK([            --zone public --remove-service cockpit], 0, [ignore])
47f735
+        FWD_CHECK([--permanent --zone work --remove-service cockpit], 0, [ignore])
47f735
+        FWD_CHECK([            --zone work --remove-service cockpit], 0, [ignore])
47f735
     ])
7d5a1d
 ])
4d3a0d
 
7d5a1d
-- 
47f735
2.27.0
7d5a1d