From 5eaf46b4c0c59f60b31a2a2aea5950a0aa27267e Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 2 Sep 2020 14:18:29 -0400 Subject: [PATCH 1/2] parser: Fix build error when compiling with DEBUG=1 A copy/paste error leads to a build failure due to an undefined variable "name" in parser_misc.c:clear_cap_flag(). Signed-off-by: Mike Salvatore --- parser/parser_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parser/parser_misc.c b/parser/parser_misc.c index 94167ac19..e412e5f78 100644 --- a/parser/parser_misc.c +++ b/parser/parser_misc.c @@ -344,7 +344,7 @@ void clear_cap_flag(capability_flags flags) int i; for (i = 0; cap_table[i].name; i++) { - PDEBUG("Checking %s %s\n", name, cap_table[i].name); + PDEBUG("Clearing capability flag for capability \"%s\"\n", cap_table[i].name); cap_table[i].flags = (capability_flags) (cap_table[i].flags & ~flags); } } From ec27d87777af8b177d26091a01377364eba30019 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Sat, 5 Sep 2020 19:59:35 -0400 Subject: [PATCH 2/2] parser: Add a debug msg to reset_parser() A debug message in reset_parser() gives developers more data about how the parser is behaving. In addition, it provides much needed context to the relatively vague debug message in clear_cap_flag(). Another solution might be to pass the profile name into clear_cap_flag(), however, clear_cap_flag() does not need the profile name, except potentially for debugging purposes. Signed-off-by: Mike Salvatore --- parser/parser_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/parser/parser_main.c b/parser/parser_main.c index 8102c5f2d..c1eefabc4 100644 --- a/parser/parser_main.c +++ b/parser/parser_main.c @@ -986,6 +986,7 @@ int process_binary(int option, aa_kernel_interface *kernel_interface, void reset_parser(const char *filename) { + PDEBUG("Resetting parser for profile %s\n", filename); memset(&mru_policy_tstamp, 0, sizeof(mru_policy_tstamp)); memset(&cache_tstamp, 0, sizeof(cache_tstamp)); mru_skip_cache = 1;