From 18d8ffe41eb92fa82b3ef19340e4b649c1215114 Mon Sep 17 00:00:00 2001 From: John Johansen Date: Thu, 11 Oct 2018 11:06:12 -0700 Subject: [PATCH] parser: do not output cache warning for stdin if not using cache Currently if stdin is used the warning apparmor_parser: cannot use or update cache, disable, or force-complain via stdin is always displayed but if caching has been disabled there is no need for this message. (backported from commit c421a29c61e66d121fa2544ba5e4c243c9a5b68c) PR: https://gitlab.com/apparmor/apparmor/merge_requests/233 Signed-off-by: John Johansen Acked-by: Christian Boltz --- parser/parser_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parser/parser_main.c b/parser/parser_main.c index 8b8c466a4..95235901f 100644 --- a/parser/parser_main.c +++ b/parser/parser_main.c @@ -759,7 +759,8 @@ int process_profile(int option, aa_kernel_interface *kernel_interface, return errno; } } else { - pwarn("%s: cannot use or update cache, disable, or force-complain via stdin\n", progname); + if (write_cache) + pwarn("%s: cannot use or update cache, disable, or force-complain via stdin\n", progname); } reset_parser(profilename);