Blame SOURCES/0039-RHEL-only-default-to-AllowZoneDrifting-yes.patch

66253d
From d31326a93b0dc1e203f4696aca4a7c0f8118d2e8 Mon Sep 17 00:00:00 2001
66253d
From: Eric Garver <eric@garver.life>
66253d
Date: Tue, 4 Feb 2020 09:12:17 -0500
66253d
Subject: [PATCH 39/39] RHEL only: default to AllowZoneDrifting=yes
66253d
66253d
---
66253d
 config/firewalld.conf               | 4 ++--
66253d
 doc/xml/firewalld.conf.xml          | 2 +-
66253d
 doc/xml/firewalld.dbus.xml          | 2 +-
66253d
 src/firewall/config/__init__.py.in  | 2 +-
66253d
 src/tests/cli/firewall-cmd.at       | 4 ++++
66253d
 src/tests/dbus/firewalld.conf.at    | 4 ++--
66253d
 src/tests/features/rfc3964_ipv4.at  | 4 ++++
66253d
 src/tests/functions.at              | 1 +
66253d
 src/tests/regression/rhbz1514043.at | 4 ++++
66253d
 9 files changed, 20 insertions(+), 7 deletions(-)
66253d
66253d
diff --git a/config/firewalld.conf b/config/firewalld.conf
66253d
index 532f0452212e..f791b2358ab8 100644
66253d
--- a/config/firewalld.conf
66253d
+++ b/config/firewalld.conf
66253d
@@ -71,5 +71,5 @@ RFC3964_IPv4=yes
66253d
 # Note: If "yes" packets will only drift from source based zones to interface
66253d
 # based zones (including the default zone). Packets never drift from interface
66253d
 # based zones to other interfaces based zones (including the default zone).
66253d
-# Possible values; "yes", "no". Defaults to "no".
66253d
-AllowZoneDrifting=no
66253d
+# Possible values; "yes", "no". Defaults to "yes".
66253d
+AllowZoneDrifting=yes
66253d
diff --git a/doc/xml/firewalld.conf.xml b/doc/xml/firewalld.conf.xml
66253d
index fcfbfd2b68c1..c21ef87813bc 100644
66253d
--- a/doc/xml/firewalld.conf.xml
66253d
+++ b/doc/xml/firewalld.conf.xml
66253d
@@ -197,7 +197,7 @@
66253d
                 to interface based zones (including the default zone). Packets
66253d
                 never drift from interface based zones to other interfaces
66253d
                 based zones (including the default zone).
66253d
-                Valid values; "yes", "no". Defaults to "no".
66253d
+                Valid values; "yes", "no". Defaults to "yes".
66253d
                 </para>
66253d
             </listitem>
66253d
         </varlistentry>
66253d
diff --git a/doc/xml/firewalld.dbus.xml b/doc/xml/firewalld.dbus.xml
66253d
index 5d77af976443..77ad77c01675 100644
66253d
--- a/doc/xml/firewalld.dbus.xml
66253d
+++ b/doc/xml/firewalld.dbus.xml
66253d
@@ -2591,7 +2591,7 @@
66253d
                 to interface based zones (including the default zone). Packets
66253d
                 never drift from interface based zones to other interfaces
66253d
                 based zones (including the default zone).
66253d
-                Valid values; "yes", "no". Defaults to "no".
66253d
+                Valid values; "yes", "no". Defaults to "yes".
66253d
             </para></listitem>
66253d
           </varlistentry>
66253d
           <varlistentry id="FirewallD1.config.Properties.AutomaticHelpers">
66253d
diff --git a/src/firewall/config/__init__.py.in b/src/firewall/config/__init__.py.in
66253d
index 481eb8de758d..645c76b66c8d 100644
66253d
--- a/src/firewall/config/__init__.py.in
66253d
+++ b/src/firewall/config/__init__.py.in
66253d
@@ -130,4 +130,4 @@ FALLBACK_AUTOMATIC_HELPERS = "no"
66253d
 FALLBACK_FIREWALL_BACKEND = "nftables"
66253d
 FALLBACK_FLUSH_ALL_ON_RELOAD = True
66253d
 FALLBACK_RFC3964_IPV4 = True
66253d
-FALLBACK_ALLOW_ZONE_DRIFTING = False
66253d
+FALLBACK_ALLOW_ZONE_DRIFTING = True
66253d
diff --git a/src/tests/cli/firewall-cmd.at b/src/tests/cli/firewall-cmd.at
66253d
index 51b367e7a0f0..3590cb23d600 100644
66253d
--- a/src/tests/cli/firewall-cmd.at
66253d
+++ b/src/tests/cli/firewall-cmd.at
66253d
@@ -1054,6 +1054,10 @@ FWD_START_TEST([rich rules priority])
66253d
 
66253d
     CHECK_LOG_AUDIT
66253d
 
66253d
+    dnl Expected test results assume this is set to "no"
66253d
+    AT_CHECK([sed -i 's/^AllowZoneDrifting.*/AllowZoneDrifting=no/' ./firewalld.conf])
66253d
+    FWD_RELOAD
66253d
+
66253d
     dnl Verify generic layout of zone
66253d
     NFT_LIST_RULES([inet], [filter_IN_public], 0, [dnl
66253d
         table inet firewalld {
66253d
diff --git a/src/tests/dbus/firewalld.conf.at b/src/tests/dbus/firewalld.conf.at
66253d
index 35aead759a9c..4eefa3286f9f 100644
66253d
--- a/src/tests/dbus/firewalld.conf.at
66253d
+++ b/src/tests/dbus/firewalld.conf.at
66253d
@@ -4,7 +4,7 @@ AT_KEYWORDS(dbus)
66253d
 dnl Verify defaults over dbus. Should be inline with default firewalld.conf.
66253d
 IF_HOST_SUPPORTS_NFT_FIB([
66253d
 DBUS_GETALL([config], [config], 0, [dnl
66253d
-string "AllowZoneDrifting" : variant string "no"
66253d
+string "AllowZoneDrifting" : variant string "yes"
66253d
 string "AutomaticHelpers" : variant string "no"
66253d
 string "CleanupOnExit" : variant string "no"
66253d
 string "DefaultZone" : variant string "public"
66253d
@@ -18,7 +18,7 @@ string "MinimalMark" : variant int32 100
66253d
 string "RFC3964_IPv4" : variant string "yes"
66253d
 ])], [
66253d
 DBUS_GETALL([config], [config], 0, [dnl
66253d
-string "AllowZoneDrifting" : variant string "no"
66253d
+string "AllowZoneDrifting" : variant string "yes"
66253d
 string "AutomaticHelpers" : variant string "no"
66253d
 string "CleanupOnExit" : variant string "no"
66253d
 string "DefaultZone" : variant string "public"
66253d
diff --git a/src/tests/features/rfc3964_ipv4.at b/src/tests/features/rfc3964_ipv4.at
66253d
index 54f5f756270b..15fef52612cc 100644
66253d
--- a/src/tests/features/rfc3964_ipv4.at
66253d
+++ b/src/tests/features/rfc3964_ipv4.at
66253d
@@ -1,6 +1,10 @@
66253d
 FWD_START_TEST([RFC3964_IPv4])
66253d
 AT_KEYWORDS(rfc3964_ipv4)
66253d
 
66253d
+dnl Expected test results assume this is set to "no"
66253d
+AT_CHECK([sed -i 's/^AllowZoneDrifting.*/AllowZoneDrifting=no/' ./firewalld.conf])
66253d
+FWD_RELOAD
66253d
+
66253d
 AT_CHECK([sed -i 's/^LogDenied.*/LogDenied=all/' ./firewalld.conf])
66253d
 AT_CHECK([sed -i 's/^RFC3964_IPv4.*/RFC3964_IPv4=yes/' ./firewalld.conf])
66253d
 FWD_RELOAD
66253d
diff --git a/src/tests/functions.at b/src/tests/functions.at
66253d
index cd4e31c7f9d4..0e28420d7123 100644
66253d
--- a/src/tests/functions.at
66253d
+++ b/src/tests/functions.at
66253d
@@ -230,6 +230,7 @@ m4_define([FWD_END_TEST], [
66253d
         IF_HOST_SUPPORTS_IP6TABLES([], [
66253d
             sed -i "/WARNING: ip6tables not usable, disabling IPv6 firewall/d" ./firewalld.log
66253d
         ])
66253d
+        sed -i "/WARNING: AllowZoneDrifting is enabled./d" ./firewalld.log
66253d
         if test x"$1" != x"ignore"; then
66253d
             if test -n "$1"; then
66253d
                 sed -i $1 ./firewalld.log
66253d
diff --git a/src/tests/regression/rhbz1514043.at b/src/tests/regression/rhbz1514043.at
66253d
index 241cf547f7f3..8e4846a078b8 100644
66253d
--- a/src/tests/regression/rhbz1514043.at
66253d
+++ b/src/tests/regression/rhbz1514043.at
66253d
@@ -1,6 +1,10 @@
66253d
 FWD_START_TEST([--set-log-denied does not zero config])
66253d
 AT_KEYWORDS(log_denied rhbz1514043)
66253d
 
66253d
+dnl Expected test results assume this is set to "no"
66253d
+AT_CHECK([sed -i 's/^AllowZoneDrifting.*/AllowZoneDrifting=no/' ./firewalld.conf])
66253d
+FWD_RELOAD
66253d
+
66253d
 FWD_CHECK([-q --set-log-denied=all])
66253d
 FWD_CHECK([-q --permanent --zone=public --add-service=samba])
66253d
 FWD_RELOAD
66253d
-- 
66253d
2.23.0
66253d