mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 00:14:44 +01:00
rc.apparmor.functions: only use systemd-detect-virt if it's present
This is a follow-up on !812, which added a call to systemd-detect-virt. Everywhere else we don't assume that program is present, and first check if it's there before we run it. Let's do the same here.
This commit is contained in:
parent
57eebd6cdb
commit
06f86e2a02
1 changed files with 2 additions and 1 deletions
|
@ -91,7 +91,8 @@ is_container_with_internal_policy() {
|
|||
local ns_name
|
||||
|
||||
# WSL needs to be detected explicitly
|
||||
if [ "$(systemd-detect-virt --container)" = "wsl" ]; then
|
||||
if [ -x /usr/bin/systemd-detect-virt ] && \
|
||||
[ "$(systemd-detect-virt --container)" = "wsl" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue