diff options
author | Phil Sutter <phil@nwl.cc> | 2020-04-21 14:10:53 +0200 |
---|---|---|
committer | Phil Sutter <phil@nwl.cc> | 2020-04-23 12:54:57 +0200 |
commit | f2ace0cdf25a5911ac84015829d65d6050a5e82d (patch) | |
tree | ae57eeb3564a38d8ca4902ac99261ce3dfa3d700 | |
parent | 4e0ad5ebf077ad5745d7dec74bfbaa92c3a34b58 (diff) |
tests: shell: Test -F in dump files
While not really useful, iptables-nft-restore shouldn't segfault either.
This tests the problem described in nfbz#1407.
Signed-off-by: Phil Sutter <phil@nwl.cc>
-rwxr-xr-x | iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0 b/iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0 new file mode 100755 index 00000000..fd82afa1 --- /dev/null +++ b/iptables/tests/shell/testcases/ipt-restore/0012-dash-F_0 @@ -0,0 +1,12 @@ +#!/bin/bash -e + +# make sure -F lines don't cause segfaults + +RULESET='*nat +-F PREROUTING +-A PREROUTING -j ACCEPT +-F PREROUTING +COMMIT' + +echo -e "$RULESET" | $XT_MULTI iptables-restore +echo -e "$RULESET" | $XT_MULTI iptables-restore -n |