All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Oester <kernel@linuxace.com>
To: Jan Engelhardt <jengelh@inai.de>
Cc: netfilter-devel@vger.kernel.org, pablo@netfilter.org
Subject: Re: [PATCH] iptables: improve chain name validation
Date: Tue, 8 Oct 2013 09:08:56 -0700	[thread overview]
Message-ID: <20131008160856.GA18402@home> (raw)
In-Reply-To: <alpine.LSU.2.11.1310071613590.6551@nerf07.vanv.qr>

On Mon, Oct 07, 2013 at 04:14:47PM +0200, Jan Engelhardt wrote:
> IMO iptables-save should just put the chain name in quotes (calling 
> xtables_save_string) if there is a need to do so.

Example:
# iptables -N 'hog wash'
# iptables -A INPUT -j 'hog wash'
iptables v1.4.20: Invalid target name `hog wash'
Try `iptables -h' or 'iptables --help' for more information.

Code:
static const char *
parse_target(const char *targetname)
{
...
        for (ptr = targetname; *ptr; ptr++)
                if (isspace(*ptr))
                        xtables_error(PARAMETER_PROBLEM,
                                   "Invalid target name `%s'", targetname);

Conclusion:
It seems pointless to allow adding chains which cannot actually be used.

Phil

  reply	other threads:[~2013-10-08 16:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-05 16:33 [PATCH] iptables: improve chain name validation Phil Oester
2013-10-07 14:14 ` Jan Engelhardt
2013-10-08 16:08   ` Phil Oester [this message]
2013-11-03 20:23 ` Pablo Neira Ayuso
2013-11-03 22:33   ` Phil Oester

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=20131008160856.GA18402@home \
    --to=kernel@linuxace.com \
    --cc=jengelh@inai.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.