From d31a9810e609070afd18c040b5e6456d6ff521a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Sun, 5 May 2019 20:09:53 +0200 Subject: [PATCH] enhance previous commit logic --- spectre-meltdown-checker.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index e48577a..78f492a 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -3857,14 +3857,17 @@ check_CVE_2018_3646_linux() # Here, we want to know if we are hosting a hypervisor, and running some VMs on it. # If we find no evidence that this is the case, assume we're not (to avoid scaring users), # this can always be overridden with --vmm in any case. - # ... ignore SC2009 as `ps ax` is actually used as a fallback if `pgrep` isn't installed - # shellcheck disable=SC2009 - if command -v pgrep >/dev/null 2>&1 && { pgrep qemu >/dev/null || pgrep kvm >/dev/null || pgrep libvirtd >/dev/null; }; then - has_vmm=1 - elif ps ax | grep -vw grep | grep -q -e '\/dev/null 2>&1; then + if pgrep qemu >/dev/null || pgrep kvm >/dev/null || pgrep libvirtd >/dev/null; then + has_vmm=1 + fi else - has_vmm=0 + # ignore SC2009 as `ps ax` is actually used as a fallback if `pgrep` isn't installed + # shellcheck disable=SC2009 + if ps ax | grep -vw grep | grep -q -e '\