2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-22 10:07:12 +00:00

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 <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
This commit is contained in:
John Johansen 2014-06-19 13:49:00 -07:00
parent 80cb9dd67b
commit 7f29e7edee

View File

@ -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;
}