netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: Harsha Sharma <harshasharmaiitr@gmail.com>,
	netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] evaluate: print error for null string befort assert statement
Date: Mon, 27 Nov 2017 23:39:55 +0100	[thread overview]
Message-ID: <20171127223955.GA26292@salvia> (raw)
In-Reply-To: <20171123212551.GA22063@breakpoint.cc>

On Thu, Nov 23, 2017 at 10:25:51PM +0100, Florian Westphal wrote:
> Harsha Sharma <harshasharmaiitr@gmail.com> wrote:
> > Print error "Null string is not allowed" before assert statement.
> > For e.g.
> > nft add rule filter input meta iifname '""'
> > Error: Null String is not allowed
> > add rule filter input meta iifname ""
> 
> Is there any case where "" should be allowed?
> 
> If not, I'd rather change scanner.l to not recognize "" as
> a quoted string.

We'll get error reporting like this if we handle this from the
scanner:

# nft add rule x y ct label \"\"
Error: syntax error, unexpected junk
add rule x y ct label ""
                      ^

This is just two extra lines in the validation step and it is not
worth to optimize an error case, ie. do it earlier. So I'm feeling
inclined to take this one.

I will mangle the error message to "Empty string is not allowed".
"Null" probably sounds too programmer thing.

Thanks!

  reply	other threads:[~2017-11-27 22:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-23 18:55 [PATCH] evaluate: print error for null string befort assert statement Harsha Sharma
2017-11-23 21:25 ` Florian Westphal
2017-11-27 22:39   ` Pablo Neira Ayuso [this message]
2017-11-27 22:48     ` Florian Westphal
2017-11-27 22:51       ` Pablo Neira Ayuso

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=20171127223955.GA26292@salvia \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=harshasharmaiitr@gmail.com \
    --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).