On Thu, Mar 27, 2014 at 12:48:11PM -0700, John Johansen wrote:
> Fix garbage characters in -p profile preprocessing output
> 
> apparmor_parser -p is broken. Outputting garbage charcters after every
> include statement.
> 
> eg.
> 
> ##included <tunables/multiarch>
> ^@^@V><A8>^?^@^@<C8>^NV><A8>^?^@^@<A0>^Pu^@# 
> -----------------------------------
> -------------------------------
> #
> 
> This is happening because includes are handled specially and should not
> go through the usual preprocessing output dump.
> 
> Signed-off-by: John Johansen <[email protected]>

Looks good to me

Acked-by: Seth Arnold <[email protected]>

> ---
>  parser/parser_lex.l |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> --- 2.9-test.orig/parser/parser_lex.l
> +++ 2.9-test/parser/parser_lex.l
> @@ -80,6 +80,12 @@
>       yy_pop_state(); \
>  } while (0)
>  
> +#define POP_NODUMP() \
> +do { \
> +     PDEBUG(" (pop_to(%s)): Matched: %s\n", 
> state_names[yy_top_state()].c_str(), yytext); \
> +     yy_pop_state(); \
> +} while (0)
> +
>  #define PUSH(X) \
>  do { \
>       DUMP_AND_DEBUG(" (push(%s)): Matched: %s\n", state_names[(X)].c_str(), 
> yytext); \
> @@ -278,12 +284,12 @@
>               char *filename = strndup(yytext, yyleng - 1);
>               include_filename(filename + 1, *filename == '<');
>               free(filename);
> -             POP();
> +             POP_NODUMP();
>       }
>  
>       [^\<\>\" \t\n]+ {       /* filename */
>               include_filename(yytext, 0);
> -             POP();
> +             POP_NODUMP();
>       }
>  }
>  
> 
> 
> -- 
> AppArmor mailing list
> [email protected]
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/apparmor
> 

Attachment: signature.asc
Description: Digital signature

-- 
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to