netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] tc/lexer: let quotes actually start strings
  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
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Bumiller @ 2018-01-18 10:32 UTC (permalink / raw)
  To: netdev
  Cc: Stephen Hemminger, Jamal Hadi Salim, Cong Wang, Jiri Pirko,
	David S . Miller

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH iproute2] tc/lexer: let quotes actually start strings
@ 2018-01-22 10:53 Wolfgang Bumiller
  2018-01-22 17:09 ` Stephen Hemminger
  2018-01-24 16:51 ` Stephen Hemminger
  0 siblings, 2 replies; 4+ messages in thread
From: Wolfgang Bumiller @ 2018-01-22 10:53 UTC (permalink / raw)
  To: netdev; +Cc: Stephen Hemminger

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>
---
(Resent as separate thread)
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH iproute2] tc/lexer: let quotes actually start strings
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2018-01-22 17:09 UTC (permalink / raw)
  To: Wolfgang Bumiller; +Cc: netdev

On Mon, 22 Jan 2018 11:53:46 +0100
Wolfgang Bumiller <w.bumiller@proxmox.com> wrote:

> 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>
> ---

This is the same patch you posted earlier. It looked fine, just that
it needs some time for people on mailing list to review.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH iproute2] tc/lexer: let quotes actually start strings
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2018-01-24 16:51 UTC (permalink / raw)
  To: Wolfgang Bumiller; +Cc: netdev

On Mon, 22 Jan 2018 11:53:46 +0100
Wolfgang Bumiller <w.bumiller@proxmox.com> wrote:

> 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>

Looks good, applied.
Don't think ematch is that widely used; or someone would have noticed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-24 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2018-01-18 10:32 [PATCH net+iproute2 0/2] nbyte, cmp and text filter fixups Wolfgang Bumiller
2018-01-18 10:32 ` [PATCH iproute2] tc/lexer: let quotes actually start strings Wolfgang Bumiller

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).