[apparmor] [patch 27/26] Add support for ipc to parser v5
Seth Arnold
seth.arnold at canonical.com
Thu Mar 27 21:40:29 UTC 2014
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 <john.johansen at canonical.com>
Looks good to me
Acked-by: Seth Arnold <seth.arnold at canonical.com>
> ---
> 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
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140327/6c88779a/attachment.pgp>
More information about the AppArmor
mailing list