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 <apparmor@cboltz.de>
Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <sbeattie@ubuntu.com>
This commit is contained in:
Christian Boltz 2020-06-11 22:15:07 +02:00 committed by John Johansen
parent 8da6cd9f6f
commit c01ed1d57b

View file

@ -25,6 +25,7 @@
%option noyy_top_state
%option nounput
%option stack
%option nodefault
%{
#include <stdio.h>