From 405dbf09f18fc40a0a569177ea4cf57448af2251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Mon, 24 May 2021 22:39:47 +0200 Subject: [PATCH] fix: refuse to run under MacOS and ESXi --- spectre-meltdown-checker.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index 3ada94f..b1b4085 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -2005,6 +2005,14 @@ if uname -a | grep -qE -- '-Microsoft #[0-9]+-Microsoft '; then exit 1 fi +# or other UNIX-ish OSes non-Linux non-supported-BSDs +if [ "$os" = Darwin ] || [ "$os" = VMkernel ]; then + _warn "You're running under the $os OS, but this script" + _warn "only works under Linux and some BSD systems, sorry." + _warn "Please read the README and FAQ for more information." + exit 1 +fi + # check for mode selection inconsistency if [ "$opt_hw_only" = 1 ]; then if [ "$opt_cve_all" = 0 ]; then @@ -2070,7 +2078,7 @@ if [ "$opt_live" = 1 ]; then _warn fi _info "Checking for vulnerabilities on current system" - _info "Kernel is \033[35m$(uname -s) $(uname -r) $(uname -v) $(uname -m)\033[0m" + _info "Kernel is \033[35m$os $(uname -r) $(uname -v) $(uname -m)\033[0m" _info "CPU is \033[35m$cpu_friendly_name\033[0m" # try to find the image of the current running kernel