From af32be0fb49f30b2455a09eba763a4caef5161ea Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Thu, 11 Jun 2020 22:15:07 +0200 Subject: [PATCH] Error out on unhandled parts when parsing a profile ... (using `%option nodefault`) instead of echoing the unknown parts to stdout, and ignoring the error. This will cause the parser to error out with flex scanner jammed and $?=2 if a profile contains unknown/invalid parts. That's not really a helpful error message, but still better than ignoring errors. MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/569 Signed-off-by: Christian Boltz Acked-by: John Johansen Acked-by: Steve Beattie (cherry picked from commit c01ed1d57b6115067f43a405b14acf24d84ff03a) --- parser/parser_lex.l | 1 + 1 file changed, 1 insertion(+) diff --git a/parser/parser_lex.l b/parser/parser_lex.l index 22db7e742..db62492a4 100644 --- a/parser/parser_lex.l +++ b/parser/parser_lex.l @@ -24,6 +24,7 @@ %option noyywrap %option nounput %option stack +%option nodefault %{ #include