[apparmor] [Patch] [Parser] Fix bare include keyword

Steve Beattie steve at nxnw.org
Sat Jun 27 05:33:20 UTC 2015


On Fri, Jun 26, 2015 at 10:42:24PM -0600, John Johansen wrote:
> On 06/24/2015 01:31 PM, Steve Beattie wrote:
> > On Wed, Jun 17, 2015 at 02:41:30AM -0700, John Johansen wrote:
> >> Fix the regression that caused using 'include' instead of '#include' for
> >> includes to stop working.
> >>
> >> Signed-off-by: John Johansen <john.johansen at canonical.com>
> >>
> >> diff --git a/parser/parser_lex.l b/parser/parser_lex.l
> >> index 5af788a..974548d 100644
> >> --- a/parser/parser_lex.l
> >> +++ b/parser/parser_lex.l
> >> @@ -517,7 +517,7 @@ LT_EQUAL	<=
> >>  	}
> >>  }
> >>  
> >> -#include/.*\r?\n	{
> >> +#?include/.*\r?\n	{
> >>  	/* Don't use PUSH() macro here as we don't want #include echoed out.
> >>  	 * It needs to be handled specially
> >>  	 */ 
> > 
> > While I'm not rescinding my ack, this does introduce a new flex warning:
> > 
> > parser_lex.l:519: warning, dangerous trailing context
> > 
> thanks for catching that, I missed it completely and it is not good and worth
> a nak

Well, cue up my rant about the default build being too verbose, making
it too easy to miss added warnings like that (yes, we still need the
possibility of verbose builds for builds in not-easily-debuggable
environments like distro build environments).

> below is a fixed patch
>
>     Fix bare include keyword
>     
>     Fix the regression that caused using 'include' instead of '#include' for
>     includes to stop working.
>     
>     Signed-off-by: John Johansen <john.johansen at canonical.com>

Acked-by: Steve Beattie <steve at nxnw.org> for both trunk and 2.9.

I tried for a bit to come up with a single regex that would match
without triggering the warning, but the only way I found that
eliminated it was duplicating the rule like you did, which I'm not
terribly thrilled about, but... *shrug*

Thanks.

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150626/8db920f8/attachment.pgp>


More information about the AppArmor mailing list