From 7f29e7edee71647a48b7a97b49f3e3b97fa39a4d Mon Sep 17 00:00:00 2001 From: John Johansen Date: Thu, 19 Jun 2014 13:49:00 -0700 Subject: [PATCH] Fix: backend processing was not treating ${} as a special pcre character Also for characters that are not recognized as a valid escape seq make sure that the character is emitted. previously \$ resulted in \ where it should have been \$ if $ wasn't recognized Signed-off-by: John Johansen Acked-by: Steve Beattie --- parser/libapparmor_re/parse.y | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/parser/libapparmor_re/parse.y b/parser/libapparmor_re/parse.y index 1755a926f..d7cf4fab8 100644 --- a/parser/libapparmor_re/parse.y +++ b/parser/libapparmor_re/parse.y @@ -172,14 +172,15 @@ int regex_lex(YYSTYPE *val, const char **pos) return *(*pos - 1); case '\\': - tmp = str_escseq(pos, "*+.|^-[]()"); - if (tmp == -1) + tmp = str_escseq(pos, "*+.|^$-[](){}"); + if (tmp == -1) { /* bad escape sequence, just skip it for now, that * is output \\ followed by the invalid esc seq * TODO: output error message */ val->c = '\\'; - else + (*pos)--; + } else val->c = tmp; break; }