Skip to content

WIP: Error out on unhandled parts when parsing a profile

Christian Boltz requested to merge cboltz/apparmor:cboltz-nodefault into master

... (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.

This fixes one testcase (but we might want a better error message), but also shows that two other testcases are broken.

NOTE: This is a proof-of-concept MR you can use as base for a "good" fix. Feel free to "steal" my commits if you find them useful.

I don't know much about flex, therefore I'm not going to work on this myself beyond what this MR contains.

Merge request reports