From 322b3f4d3e4b85a18063d21ee91291946ef0492d Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 15 Feb 2022 07:31:31 +0000 Subject: [PATCH] profile-load: use less ambiguous if/then construct As shellcheck taught me today (https://github.com/koalaman/shellcheck/wiki/SC2015), "A && B || C is not if-then-else. C may run when A is true". It does not matter here in practice, because worst case we would run "true" once too many, but still. --- parser/profile-load | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/parser/profile-load b/parser/profile-load index 95b474ee3..7591fb3e1 100755 --- a/parser/profile-load +++ b/parser/profile-load @@ -24,7 +24,11 @@ . /lib/apparmor/rc.apparmor.functions # do not load in a container -[ -x /usr/bin/systemd-detect-virt ] && systemd-detect-virt --quiet --container && ! is_container_with_internal_policy && exit 0 || true +if [ -x /usr/bin/systemd-detect-virt ] && \ + systemd-detect-virt --quiet --container && \ + ! is_container_with_internal_policy; then + exit 0 +fi [ -d /rofs/etc/apparmor.d ] && exit 0 # do not load if running liveCD