From 1fb96df369400295cc5bf53b922be8a557bcbb44 Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Tue, 3 Mar 2020 12:36:22 +0100 Subject: [PATCH] Avoid external "/bin/pwd" .. as it may not be everywhere available, see #1521 (NixOS). This commit replaces all instances from pwd or /bin/pwd by `pwd -P` (-P -> no symbolic link) --- testssl.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testssl.sh b/testssl.sh index 27c4a40..837c9f5 100755 --- a/testssl.sh +++ b/testssl.sh @@ -7293,7 +7293,7 @@ extract_certificates() { # Place the server's certificate in $HOSTCERT and any intermediate # certificates that were provided in $TEMPDIR/intermediatecerts.pem - savedir=$(pwd); cd $TEMPDIR + savedir=$(pwd -P); cd $TEMPDIR # http://backreference.org/2010/05/09/ocsp-verification-with-openssl/ if [[ "$version" == ssl2 ]]; then awk -v n=-1 '/Server certificate/ {start=1} @@ -18035,9 +18035,9 @@ find_openssl_binary() { openssl_location="$(type -p $OPENSSL)" [[ -n "$GIT_REL" ]] && \ - cwd="$(/bin/pwd)" || \ + cwd="$(pwd -P)" || \ cwd="$RUN_DIR" - if [[ "$openssl_location" =~ $(/bin/pwd)/bin ]]; then + if [[ "$openssl_location" =~ $(pwd -P)/bin ]]; then OPENSSL_LOCATION="\$PWD/bin/$(basename "$openssl_location")" elif [[ "$openssl_location" =~ $cwd ]] && [[ "$cwd" != '.' ]]; then OPENSSL_LOCATION="${openssl_location%%$cwd}"