From: Pablo Neira Ayuso Date: Thu, 27 Jun 2024 00:51:57 +0000 (+0200) Subject: tests: shell: check for removing table via handle with incorrect family X-Git-Tag: v1.1.0~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa44b61a560d8e51bb19410d449d8c46ef3a63a4;p=thirdparty%2Fnftables.git tests: shell: check for removing table via handle with incorrect family This test checks for upstream commit: f6e1532a2697 ("netfilter: nf_tables: validate family when identifying table via handle") Signed-off-by: Pablo Neira Ayuso --- diff --git a/tests/shell/testcases/transactions/handle_bad_family b/tests/shell/testcases/transactions/handle_bad_family new file mode 100755 index 00000000..59224189 --- /dev/null +++ b/tests/shell/testcases/transactions/handle_bad_family @@ -0,0 +1,9 @@ +#!/bin/bash + +NFT=nft + +HANDLE=$($NFT -a -e add table ip x | cut -d '#' -f 2 | awk '{ print $2 }' | head -1) + +# should fail +$NFT delete table inet handle $HANDLE +[ $? -ne 0 ] && exit 0