From 92b28c5f1ca2d120e1a4278e8c1ad69140833e01 Mon Sep 17 00:00:00 2001 From: Dirk Date: Mon, 30 Oct 2023 15:11:10 +0100 Subject: [PATCH] Fix weird bash globbing #2429 What was problematic was the error message when the certificate stores were missing. This fixes it by redirecting the error message to /dev/null so that if the sub function detects the missing file it returns with an error by the program and not by executing "basename" --- testssl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index 5732d03..9b0ec76 100755 --- a/testssl.sh +++ b/testssl.sh @@ -7619,7 +7619,7 @@ determine_trust() { ca_bundles="$CA_BUNDLES_PATH/*.pem" fi for bundle_fname in $ca_bundles; do - certificate_file[i]=$(basename ${bundle_fname//.pem}) + certificate_file[i]=$(basename ${bundle_fname//.pem 2>/dev/null}) if [[ ! -r $bundle_fname ]]; then prln_warning "\"$bundle_fname\" cannot be found / not readable" return 1