Blame SOURCES/0025-tests-shell-Test-F-in-dump-files.patch

598666
From dd98af599516806e2eb3e1186d0ad52ce7c6b4b5 Mon Sep 17 00:00:00 2001
598666
From: Phil Sutter <phil@nwl.cc>
598666
Date: Tue, 21 Apr 2020 14:10:53 +0200
598666
Subject: [PATCH] tests: shell: Test -F in dump files
598666
598666
While not really useful, iptables-nft-restore shouldn't segfault either.
598666
This tests the problem described in nfbz#1407.
598666
598666
Signed-off-by: Phil Sutter <phil@nwl.cc>
598666
(cherry picked from commit f2ace0cdf25a5911ac84015829d65d6050a5e82d)
598666
Signed-off-by: Phil Sutter <psutter@redhat.com>
598666
---
598666
 .../tests/shell/testcases/ipt-restore/0012-dash-F_0  | 12 ++++++++++++
598666
 1 file changed, 12 insertions(+)
598666
 create mode 100755 iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0
598666
598666
diff --git a/iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0 b/iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0
598666
new file mode 100755
598666
index 0000000000000..fd82afa1bc8ce
598666
--- /dev/null
598666
+++ b/iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0
598666
@@ -0,0 +1,12 @@
598666
+#!/bin/bash -e
598666
+
598666
+# make sure -F lines don't cause segfaults
598666
+
598666
+RULESET='*nat
598666
+-F PREROUTING
598666
+-A PREROUTING -j ACCEPT
598666
+-F PREROUTING
598666
+COMMIT'
598666
+
598666
+echo -e "$RULESET" | $XT_MULTI iptables-restore
598666
+echo -e "$RULESET" | $XT_MULTI iptables-restore -n
598666
-- 
598666
2.27.0
598666