From c01ed1d57b6115067f43a405b14acf24d84ff03a 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 --- parser/parser_lex.l | 1 + 1 file changed, 1 insertion(+) diff --git a/parser/parser_lex.l b/parser/parser_lex.l index 97c2e849b..97250f958 100644 --- a/parser/parser_lex.l +++ b/parser/parser_lex.l @@ -25,6 +25,7 @@ %option noyy_top_state %option nounput %option stack +%option nodefault %{ #include