diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2024-06-27 02:51:57 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2024-06-27 03:32:55 +0200 |
commit | aa44b61a560d8e51bb19410d449d8c46ef3a63a4 (patch) | |
tree | 01275d3c10f0033faeff306d92952e5620b85d0d /tests/shell/testcases/transactions | |
parent | 081bf5f0d7952a6e6ac0d23a365ccf1fd27010c0 (diff) |
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 <pablo@netfilter.org>
Diffstat (limited to 'tests/shell/testcases/transactions')
-rwxr-xr-x | tests/shell/testcases/transactions/handle_bad_family | 9 |
1 files changed, 9 insertions, 0 deletions
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 |