mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 10:07:12 +00: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
@ -24,7 +24,11 @@
|
|||||||
. /lib/apparmor/rc.apparmor.functions
|
. /lib/apparmor/rc.apparmor.functions
|
||||||
|
|
||||||
# do not load in a container
|
# 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
|
[ -d /rofs/etc/apparmor.d ] && exit 0 # do not load if running liveCD
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user