Skip to content

Commit

Permalink
Fix weird bash globbing (3.0)
Browse files Browse the repository at this point in the history
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"

As for 3.2 this is for the 3.0 branch.
  • Loading branch information
drwetter committed Oct 30, 2023
1 parent 3eb3994 commit 775ed60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion testssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7094,7 +7094,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
Expand Down

0 comments on commit 775ed60

Please sign in to comment.