]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: add quotes when using <<<-style here document
authorFlorian Westphal <fw@strlen.de>
Fri, 8 Jun 2018 12:41:08 +0000 (14:41 +0200)
committerFlorian Westphal <fw@strlen.de>
Fri, 8 Jun 2018 12:41:08 +0000 (14:41 +0200)
bash 4.3.30 removes newlines in RULESET when "" are omitted, which
then causes nft -f to complain about invalid syntax.

As a result, all test cases that use this here-doc style fail.

Signed-off-by: Florian Westphal <fw@strlen.de>
52 files changed:
tests/shell/testcases/cache/0001_cache_handling_0
tests/shell/testcases/cache/0002_interval_0
tests/shell/testcases/import/vm_json_import_0
tests/shell/testcases/maps/0006interval_map_overlap_0
tests/shell/testcases/netns/0001nft-f_0
tests/shell/testcases/netns/0003many_0
tests/shell/testcases/nft-f/0001define_slash_0
tests/shell/testcases/nft-f/0006action_object_0
tests/shell/testcases/nft-f/0007action_object_set_segfault_1
tests/shell/testcases/nft-f/0008split_tables_0
tests/shell/testcases/nft-f/0009variable_0
tests/shell/testcases/nft-f/0010variable_0
tests/shell/testcases/nft-f/0012different_defines_0
tests/shell/testcases/nft-f/0013defines_1
tests/shell/testcases/nft-f/0014defines_1
tests/shell/testcases/nft-f/0015defines_1
tests/shell/testcases/nft-f/0016redefines_1
tests/shell/testcases/sets/0001named_interval_0
tests/shell/testcases/sets/0008create_verdict_map_0
tests/shell/testcases/sets/0014malformed_set_is_not_defined_0
tests/shell/testcases/sets/0015rulesetflush_0
tests/shell/testcases/sets/0021nesting_0
tests/shell/testcases/sets/0022type_selective_flush_0
tests/shell/testcases/sets/0024named_objects_0
tests/shell/testcases/sets/0026named_limit_0
tests/shell/testcases/sets/0027ipv6_maps_ipv4_0
tests/shell/testcases/sets/0031set_timeout_size_0
tests/shell/testcases/transactions/0001table_0
tests/shell/testcases/transactions/0002table_0
tests/shell/testcases/transactions/0003table_0
tests/shell/testcases/transactions/0010chain_0
tests/shell/testcases/transactions/0011chain_0
tests/shell/testcases/transactions/0012chain_0
tests/shell/testcases/transactions/0013chain_0
tests/shell/testcases/transactions/0014chain_1
tests/shell/testcases/transactions/0015chain_0
tests/shell/testcases/transactions/0020rule_0
tests/shell/testcases/transactions/0021rule_0
tests/shell/testcases/transactions/0022rule_1
tests/shell/testcases/transactions/0023rule_1
tests/shell/testcases/transactions/0030set_0
tests/shell/testcases/transactions/0031set_0
tests/shell/testcases/transactions/0032set_0
tests/shell/testcases/transactions/0033set_0
tests/shell/testcases/transactions/0034set_0
tests/shell/testcases/transactions/0035set_0
tests/shell/testcases/transactions/0036set_1
tests/shell/testcases/transactions/0037set_0
tests/shell/testcases/transactions/0038set_0
tests/shell/testcases/transactions/0039set_0
tests/shell/testcases/transactions/0040set_0
tests/shell/testcases/transactions/0041nat_restore_0

index 77afdf8d907281794d635df807d7bb658672ca9f..f3dc9a347972316e1f334e8af145f54daf4e773d 100755 (executable)
@@ -15,7 +15,7 @@ table inet test {
 
 set -e
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 TMP=$(mktemp)
 echo "$RULESET" >> "$TMP"
 $NFT "flush ruleset;include \"$TMP\""
@@ -23,4 +23,4 @@ rm -f "$TMP"
 rule_handle=$($NFT list ruleset -a | awk '/saddr/{print $NF}')
 $NFT delete rule inet test test handle $rule_handle
 $NFT delete set inet test test
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index 0c010c1f5f07f6146a61c8faa7549ed2f4a6d54e..506a6c8ad449938f5b67779dcf6856a12457b88e 100755 (executable)
@@ -14,5 +14,5 @@ add element inet t s {
        192.168.0.1/24,
 }"
 
-$NFT -f - <<< $RULESET
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
+$NFT -f - <<< "$RULESET"
index a8d546ff956eb4114e61aab34abb4817c7d1370c..546ccf7ab490f296e67b43e910cd4dbe32842611 100755 (executable)
@@ -47,7 +47,7 @@ table ip6 x {
        }
 }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 RULESET_JSON=$($NFT export vm json)
 $NFT flush ruleset
-$NFT import vm json <<< $RULESET_JSON
+$NFT import vm json <<< "$RULESET_JSON"
index d63a396d30ee822ed03c3ca8ff86a122c02443af..4606ce3e3618e8c198f614cd7ecda4facf064cfb 100755 (executable)
@@ -10,7 +10,7 @@ add map x y { type ipv4_addr : ipv4_addr; flags interval; }
 add element x y { 10.0.${n}.0/24 : 10.0.0.${n} }"
 
 set -e
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 
 n=2
 $NFT "add element x y { 10.0.${n}.0/24 : 10.0.0.${n} }"
index a6c854d25c2c654ae7918f363fcbf803f67eb757..642498260e00c2a28eff61d0831cefa96b89edc4 100755 (executable)
@@ -83,7 +83,7 @@ if [ $? -ne 0 ] ; then
        exit 1
 fi
 
-$IP netns exec $NETNS_NAME $NFT -f - <<< $RULESET
+$IP netns exec $NETNS_NAME $NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
        echo "E: unable to load ruleset in netns" >&2
        $IP netns del $NETNS_NAME
index c3595de8e5d56d6c4630f2bd769204bff6ce2735..5ec4b2e4358ffb27f62ab6691237705aac132f37 100755 (executable)
@@ -87,7 +87,7 @@ function test_netns()
                exit 1
        fi
 
-       $IP netns exec $NETNS_NAME $NFT -f - <<< $RULESET
+       $IP netns exec $NETNS_NAME $NFT -f - <<< "$RULESET"
        if [ $? -ne 0 ] ; then
                echo "E: unable to load ruleset in netns" >&2
                $IP netns del $NETNS_NAME
index 8712fbf88ef340d48a307444a9e44a0d0d89932e..93c48115b11ba0741fa2af4af155d8bec87f4681 100755 (executable)
@@ -8,4 +8,4 @@ define net = 1.1.1.1/24
 
 set -e
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index 6e3b0b2e582564bd06c362f4fd5322359542665d..b9766f2dbb72140350d01d93bc0234e376ca5f5a 100755 (executable)
@@ -50,7 +50,7 @@ RULESET=$(for family in $FAMILIES ; do
        generate2 $family
 done)
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
        echo "E: unable to load ruleset 2" >&2
        exit 1
index 7649a49608183750af0e6ac05890f0f505ffacc3..933a2f62ae436acb0f479bbacb366f2cf9d848a5 100755 (executable)
@@ -10,4 +10,4 @@ add set t s {type ipv4_addr\;}
 add rule t c ip saddr @s
 "
 
-$NFT -f - <<< $RULESET 2>/dev/null
+$NFT -f - <<< "$RULESET" 2>/dev/null
index 14cdd49977a269431c1e831c87086fa7c60a12dd..c4ca717fe5dbf1d1ea33051ccaa70fdabc63b098 100755 (executable)
@@ -15,7 +15,7 @@ table inet filter {
        }
 }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index 8ff6b7cf20bcd882874a0399b93925768c40d986..e073d86c5078eea643a51cf38b0c8f582eb06254 100755 (executable)
@@ -11,4 +11,4 @@ table inet forward {
        }
 }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index be02c6bf41628d9326af60e4355ea34d975f84a7..69c80c79ae597c4bd723fe776e276d620ee1c569 100755 (executable)
@@ -10,4 +10,4 @@ table inet filter {
 add element inet filter whitelist_v4 \$whitelist_v4
 "
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index c17b06b18d236bc21ce4c08b8e65a4c416408dd5..0bdbd1b5f147dc85a7b9cec9304f09cbfbb778d7 100755 (executable)
@@ -33,4 +33,4 @@ table inet t {
 }"
 
 set -e
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index b6d575c93452dc09a6a7e14939de514a07009b46..1dd5b569c386a84ebaf46d59005baa9518b3bb28 100755 (executable)
@@ -14,4 +14,4 @@ table ip t {
        }
 }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index 77d766ec5215cc1f0f3ee2e973863b0c8177b40f..c8e73c243fc6b1850d1006d6fb30f40a18cee132 100755 (executable)
@@ -14,4 +14,4 @@ table ip t {
        }
 }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index 8aaa7bb10d592e1caf0b12319f5cfd0f299c38b4..489c65b5cffe40402697e6b749342b2ead6e30ec 100755 (executable)
@@ -13,4 +13,4 @@ table ip t {
        }
 }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index 9a6a764a3d97429fe23af7722fe4fc4a28e29d6a..ed702c90addd6dcb2f65f33a97075cf93c0e48b2 100755 (executable)
@@ -21,7 +21,7 @@ EXPECTED="table ip x {
         }
 }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 
 GET="$($NFT list ruleset)"
 
index 740981252f8680db22e15e84f77960222a9e5641..612eee0ca1d01ed9d39828ae7a5089b86d721389 100755 (executable)
@@ -36,4 +36,4 @@ table inet t {
 }"
 
 set -e
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index 1188e977c96ed952677190e176799de82b6e3b6b..e5010496fabda163dffd77ef952b284ec111adf1 100755 (executable)
@@ -14,4 +14,4 @@ add element t sourcemap { 100.123.10.2 : jump c }
 "
 
 set -e
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index 61d6b49ceeac20816385051799e979aa8f4cbf80..b34d71fddeb5d43f852bf01aaeaf3eba65e4c37a 100755 (executable)
@@ -14,7 +14,7 @@ add set t s {type ipv4_addr\;}
 add rule t c ip saddr @s
 "
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 ret=$?
 
 trap - EXIT
index 3bfab97cf1c4537d0e98f92c289c6466de140763..855d289a960d4721833e667f6b132544b9cc8dd2 100755 (executable)
@@ -12,7 +12,7 @@ add element inet filter blacklist_v4 {
 192.168.0.1/24,
 }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 
 # make sure flush ruleset works right
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index c0ac396f8b31aba5e276b66a545eeea00bead206..c8d8f05792abf611f0589d45fff4362511aebadb 100755 (executable)
@@ -16,7 +16,7 @@ table ip x {
        }
 }'
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load ruleset" >&2
         exit 1
index a20a863a696649f35f547ead67c8a3ee51f97eb9..6062913b52729a16581fce98fdd39d75d3fe3b2d 100755 (executable)
@@ -11,7 +11,7 @@ add map t m {type ipv4_addr : inet_service;}
 add rule t c tcp dport 80 meter f size 1024 {ip saddr limit rate 10/second}
 "
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 
 # Commands that should be invalid
 
index 772247e0994d5b91b14152d488729c7d417c54c4..10f99b62a1434de03a9afa0076df88373c31e232 100755 (executable)
@@ -30,4 +30,4 @@ table inet x {
 }"
 
 set -e
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index 23bc0b02b8e8a810f0ea847ff6a3404258b31b2e..11f1f5d96cf66a8c7f065590a62ad5ef45ac32d0 100755 (executable)
@@ -16,4 +16,4 @@ table ip filter {
 }"
 
 set -e
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index 846e3226ae05d9d710caac260d6c0d7f834d8c59..87603c5e1fa2370e75fdb4ab94ce7823c50c727c 100755 (executable)
@@ -14,4 +14,4 @@ table inet t {
 }
 "
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
index 747d7dc7a5197c3b449caa3d6d431135beca58e0..514c503b349b06616d08eef49ab44d9137e075c0 100755 (executable)
@@ -7,6 +7,6 @@ add rule x test set update ip saddr timeout 1d2h3m4s5ms @y
 add rule x test set update ip daddr timeout 100ms @y"
 
 set -e
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 $NFT list chain x test | grep -q 'update @y { ip saddr timeout 1d2h3m4s5ms }'
 $NFT list chain x test | grep -q 'update @y { ip daddr timeout 100ms }'
index 1a8ecb8663c7bd5345a5a5e0aae9aaac55e7c2db..99298244a5f759f92106daf818d5cebaf425e0d3 100755 (executable)
@@ -7,7 +7,7 @@ delete table x
 add table x
 add table y"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index 290ea436dc9b82e22c3b2e6b49ddce03bafc47b8..246b10924d19bab6feae1944d04778c15a4a75de 100755 (executable)
@@ -7,7 +7,7 @@ delete table x
 add table x
 add table x { flags dormant; }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index c5a87d3f04173be08dce85a88d8577302946c750..6e508fc2a02c7dbbb85ea955512636d84507629d 100755 (executable)
@@ -6,7 +6,7 @@ RULESET="add table x
 add table y
 flush ruleset"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index 39a5fe9eb9ca7b84df143b5f0c1a63282ce8de80..ce66bd64ba9c9052fcdbd15ec5dbcec2d4240e3c 100755 (executable)
@@ -8,7 +8,7 @@ flush ruleset
 add table w
 add chain w y"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index 7dca12874a7e2e922d219946aeed88b94b11dfe5..3bed16dddf40bb5b00b2d4cc751252e9c1550ad4 100755 (executable)
@@ -8,7 +8,7 @@ delete chain x y
 add chain x y { type filter hook input priority 0; }
 add chain x y { policy drop; }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index 7ebfad42bfed16b09b233c0a62d5a983ad13061e..0d80ef4e74d5b4632906d1e9348eaffd7f6c3861 100755 (executable)
@@ -12,7 +12,7 @@ flush ruleset
 add table w
 add chain w y { type filter hook output priority 0; }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index 383e834771aa369b2d4135214b6ad2571a6bf562..2756dd6084deea9e52049dd9d3f88ae8ffb1e061 100755 (executable)
@@ -13,7 +13,7 @@ flush ruleset
 add table w
 add chain w y { type filter hook output priority 0; }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index 40cea8b21448410abeaad3b00dd308e07cab32d2..802a7e63a937c4f61c172c55772b2e1b093d37a8 100755 (executable)
@@ -7,5 +7,5 @@ add chain x y
 delete chain x y
 delete chain x y"
 
-$NFT -f - <<< $RULESET 2>/dev/null
+$NFT -f - <<< "$RULESET" 2>/dev/null
 echo "E: allowing double-removal of chain" >&2
index 90f87182ef54ad9ba0d211ec3b2f9cb37134c2af..42950b37fa73a50d748334e07d6f3ce8c73ad278 100755 (executable)
@@ -7,7 +7,7 @@ add chain x y
 add chain x z
 add rule x z jump y"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
@@ -18,7 +18,7 @@ delete chain x z
 delete chain x y
 delete table x"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index b8e4cff56c2de8952367c6f58098c61699aaa291..f8d2d377fbf9497d8b7ac9fe9d9bd3c29db179cb 100755 (executable)
@@ -7,7 +7,7 @@ add chain x y
 add rule x y ip saddr 1.1.1.1 counter
 flush ruleset"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index f5f6eb8bb82e9c17c818c10ef77a774bf449ae89..ee265abd64c9e3687ab4f410deff82c564dcac92 100755 (executable)
@@ -10,7 +10,7 @@ add table x
 add chain x y
 add rule x y ip saddr 2.2.2.2 counter"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index 83c72af13f82659a6c040cba4d33857eb10dc0c0..0e7c9a6f9da9545524de1ddfe6f5a1571d3ad53a 100755 (executable)
@@ -8,5 +8,5 @@ delete chain x y
 add rule x y jump y"
 
 # kernel must return ENOENT
-$NFT -f - <<< $RULESET 2>/dev/null
+$NFT -f - <<< "$RULESET" 2>/dev/null
 echo "E: allowing jump loop to unexisting chain"
index b43a0cce831977e2f98ebbc995061338d1bd8db0..edc4e8d2984d623f976437bb746784d712f91ff0 100755 (executable)
@@ -7,5 +7,5 @@ add chain x y
 add rule x y jump y"
 
 # kernel must return ELOOP
-$NFT -f - <<< $RULESET 2>/dev/null
+$NFT -f - <<< "$RULESET" 2>/dev/null
 echo "E: allowing jump to chain loop"
index 464bc2b32aa3076338aeb454b50b685bbc440f32..e17b42f3f97e0a64201c072ec6bf3d2e26c51493 100755 (executable)
@@ -7,7 +7,7 @@ add set x y { type ipv4_addr; }
 flush ruleset
 add table x"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index 0bab49933f06b296a4d9a55780a6c6ed54b32c2a..b2133cfeef73f8f0048ba0926c381f090f452f52 100755 (executable)
@@ -7,7 +7,7 @@ add set x y { type ipv4_addr; }
 delete set x y
 add set x y { type ipv4_addr; }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index 126f37e5ae166b66400b7cc6e389d6427fefb9da..5882518bd3eb999a711777b5dca4ee8bd682bbf5 100755 (executable)
@@ -8,7 +8,7 @@ flush ruleset
 add table w
 add set w y { type ipv4_addr; }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index f7a31e8c42f69e7900772482f3474288204ad13a..6bd5893a8e962919c3b9b07f5601bc8c9d291aac 100755 (executable)
@@ -6,7 +6,7 @@ RULESET="add table x
 add set x y { type ipv4_addr; }
 delete set x y"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index 882610322f7210ea471ae90e25f7543764144ac1..1580c32141e403ce7f40223b058826dd682be69c 100755 (executable)
@@ -7,7 +7,7 @@ add set x y { type ipv4_addr; }
 add element x y { 1.1.1.1 }
 delete element x y { 1.1.1.1 }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index d442b68efe09dc24d4e49c47e6a7597f37d102f4..0967fd42faf94fd6a0fb88e06569ccbdf6565b9f 100755 (executable)
@@ -9,7 +9,7 @@ delete element x y { 1.1.1.1 }
 delete element x y { 2.2.2.2 }
 add element x y { 3.3.3.3 }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index a0deb7a032633c1271adb566c6ca08111b22a694..e691fa7f8db6ed96ce6176e08dd1444f0bbfc4dd 100755 (executable)
@@ -8,6 +8,6 @@ add element x y { 1.1.1.1, 2.2.2.2 }
 delete element x y { 1.1.1.1 }
 delete element x y { 1.1.1.1 }"
 
-$NFT -f - <<< $RULESET 2> /dev/null
+$NFT -f - <<< "$RULESET" 2> /dev/null
 # Kernel must return ENOENT
 echo "E: allowing double-removal of element"
index 4aef63f1795f236e5efea00f894298f48c306f75..2882863d9dce50780eb951e5624f3f4a4c582309 100755 (executable)
@@ -7,7 +7,7 @@ add set x y { type ipv4_addr; flags interval;}
 add element x y { 1.1.1.0/24 }
 delete element x y { 1.1.1.0/24 }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index fc9f1ca4dcd841d6d3214b6d71dfa1929b0db9aa..d7c2ba3df71829d6a8c7ca097828c9fe08db5193 100755 (executable)
@@ -9,7 +9,7 @@ delete element x y { 192.168.0.0/24 }
 delete element x y { 192.168.2.0/24 }
 add element x y { 192.168.4.0/24 }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index fc9f1ca4dcd841d6d3214b6d71dfa1929b0db9aa..d7c2ba3df71829d6a8c7ca097828c9fe08db5193 100755 (executable)
@@ -9,7 +9,7 @@ delete element x y { 192.168.0.0/24 }
 delete element x y { 192.168.2.0/24 }
 add element x y { 192.168.4.0/24 }"
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index 7386ecfb9a2ae290cc0301fcdac3bf8acc109d43..c991b84e1bb7ae09480bfd606153e0c5f3f4ac40 100755 (executable)
@@ -20,7 +20,7 @@ RULESET="table ip filter {
        chain CIn_1 {
        }
 }"
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
@@ -36,7 +36,7 @@ fi
 
 RULESET="delete element ip filter client_to_any { 1.2.3.4 : goto CIn_1 }
 delete chain ip filter CIn_1"
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 if [ $? -ne 0 ] ; then
         echo "E: unable to load good ruleset" >&2
         exit 1
index 62971852dfa13e14eb81f6c3d292872096c57b9f..9e1d6c96e7a19b9f271a61f35ddf3799a9acac86 100755 (executable)
@@ -7,11 +7,11 @@ add table ip t
 add chain ip t c { type nat hook postrouting priority 0; }
 "
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"
 
 RULESET="
 flush ruleset
 $RULESET
 "
 
-$NFT -f - <<< $RULESET
+$NFT -f - <<< "$RULESET"