mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 10:07:12 +00:00
Require matched mode strings to terminate
mode strings overlap with other potential commands, or strings, and as currently written can be match as a leading substring of an ID. Eliminate the leading substring case by requiring that for a mode string to be recognized it must be terminated by whitespace, eol, eof, or comma (end of rule). The other cases where modes string overlap are ambiguous and the ID should be quoted to remove the ambiguity. Signed-off-by: John Johansen <john.johansen@canonical.com> Acked-by: Kees Cook <kees@ubuntu.com>
This commit is contained in:
parent
def8c20168
commit
8a3edd677c
@ -540,7 +540,7 @@ LT_EQUAL <=
|
|||||||
return TOK_ID;
|
return TOK_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
{MODES} {
|
({MODES})/([[:space:],]) {
|
||||||
DUMP_PREPROCESS;
|
DUMP_PREPROCESS;
|
||||||
yylval.mode = strdup(yytext);
|
yylval.mode = strdup(yytext);
|
||||||
PDEBUG("Found modes: %s\n", yylval.mode);
|
PDEBUG("Found modes: %s\n", yylval.mode);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user