netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: netdev@vger.kernel.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>,
	"David S . Miller" <davem@davemloft.net>
Subject: [PATCH iproute2] tc/lexer: let quotes actually start strings
Date: Thu, 18 Jan 2018 11:32:34 +0100	[thread overview]
Message-ID: <20180118103236.32494-2-w.bumiller@proxmox.com> (raw)
In-Reply-To: <20180118103236.32494-1-w.bumiller@proxmox.com>

The lexer will go with the longest match, so previously
the starting double quotes of a string would be swallowed by
the [^ \t\r\n()]+ pattern leaving the user no way to
actually use strings with escape sequences.
Fix this by not allowing this case to start with double
quotes.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
---
 tc/emp_ematch.l | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tc/emp_ematch.l b/tc/emp_ematch.l
index dc106759..d7a99304 100644
--- a/tc/emp_ematch.l
+++ b/tc/emp_ematch.l
@@ -137,7 +137,7 @@
 ")"					{
 						return yylval.i = *yytext;
 					}
-[^ \t\r\n()]+				{
+[^" \t\r\n()][^ \t\r\n()]*		{
 						yylval.b = bstr_alloc(yytext);
 						if (yylval.b == NULL)
 							return ERROR;
-- 
2.11.0

  reply	other threads:[~2018-01-18 10:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 10:32 [PATCH net+iproute2 0/2] nbyte, cmp and text filter fixups Wolfgang Bumiller
2018-01-18 10:32 ` Wolfgang Bumiller [this message]
2018-01-18 10:32 ` [PATCH net 1/2] net: sched: em_nbyte: don't add the data offset twice Wolfgang Bumiller
2018-01-24 19:53   ` David Miller
2018-01-18 10:32 ` [PATCH net 2/2] net_sched: fix TCF_LAYER_LINK case in tcf_get_base_ptr Wolfgang Bumiller
2018-01-24 19:53   ` David Miller
2018-01-18 10:59 ` [PATCH net+iproute2 0/2] nbyte, cmp and text filter fixups Jiri Pirko
  -- strict thread matches above, loose matches on Subject: below --
2018-01-22 10:53 [PATCH iproute2] tc/lexer: let quotes actually start strings Wolfgang Bumiller
2018-01-22 17:09 ` Stephen Hemminger
2018-01-24 16:51 ` Stephen Hemminger

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=20180118103236.32494-2-w.bumiller@proxmox.com \
    --to=w.bumiller@proxmox.com \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=xiyou.wangcong@gmail.com \
    /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).