mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 00:14:44 +01:00
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.
This commit is contained in:
parent
35f23a6da1
commit
322b3f4d3e
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue