From: Phil Sutter <phil@nwl.cc>
To: netfilter-devel@vger.kernel.org
Subject: [iptables PATCH 2/4] *tables: Reject invalid chain names when renaming
Date: Fri, 28 Jul 2023 14:31:45 +0200 [thread overview]
Message-ID: <20230728123147.15750-2-phil@nwl.cc> (raw)
In-Reply-To: <20230728123147.15750-1-phil@nwl.cc>
While given chain name was sanity checked with --new-chain command,
--rename-chain command allowed to choose an invalid name. Keep things
consistent by adding the missing check.
Fixes: e6869a8f59d77 ("reorganized tree after kernel merge")
Signed-off-by: Phil Sutter <phil@nwl.cc>
---
iptables/xshared.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/iptables/xshared.c b/iptables/xshared.c
index 28c65faed7b25..5f75a0a57a023 100644
--- a/iptables/xshared.c
+++ b/iptables/xshared.c
@@ -1511,6 +1511,7 @@ void do_parse(int argc, char *argv[],
"-%c requires old-chain-name and "
"new-chain-name",
cmd2char(CMD_RENAME_CHAIN));
+ assert_valid_chain_name(p->newname);
break;
case 'P':
--
2.40.0
next prev parent reply other threads:[~2023-07-28 12:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-28 12:31 [iptables PATCH 1/4] *tables-restore: Enforce correct counters syntax if present Phil Sutter
2023-07-28 12:31 ` Phil Sutter [this message]
2023-07-28 12:31 ` [iptables PATCH 3/4] ebtables: Improve invalid chain name detection Phil Sutter
2023-07-28 12:31 ` [iptables PATCH 4/4] tests: shell: Fix and extend chain rename test Phil Sutter
2023-07-28 17:34 ` [iptables PATCH 1/4] *tables-restore: Enforce correct counters syntax if present Phil Sutter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230728123147.15750-2-phil@nwl.cc \
--to=phil@nwl.cc \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).