FIX #654 (no logfile when -file is specified)

This commit is contained in:
Dirk 2017-03-23 16:19:23 +01:00
parent f8bb74519d
commit faefe62bea

View File

@ -7933,7 +7933,7 @@ parse_hn_port() {
echo "$NODE" | grep -q 'https://' && NODE=$(echo "$NODE" | sed -e 's/^https\:\/\///') echo "$NODE" | grep -q 'https://' && NODE=$(echo "$NODE" | sed -e 's/^https\:\/\///')
# strip trailing urlpath # strip trailing urlpath
NODE=$(echo "$NODE" | sed -e 's/\/.*$//') NODE=$(sed -e 's/\/.*$//' <<< "$NODE")
# if there's a trailing ':' probably a starttls/application protocol was specified # if there's a trailing ':' probably a starttls/application protocol was specified
if grep -q ':$' <<< $NODE ; then if grep -q ':$' <<< $NODE ; then
@ -7941,7 +7941,7 @@ parse_hn_port() {
fi fi
# was the address supplied like [AA:BB:CC::]:port ? # was the address supplied like [AA:BB:CC::]:port ?
if echo "$NODE" | grep -q ']' ; then if grep -q ']' <<< "$NODE" ; then
tmp_port=$(printf "$NODE" | sed 's/\[.*\]//' | sed 's/://') tmp_port=$(printf "$NODE" | sed 's/\[.*\]//' | sed 's/://')
# determine v6 port, supposed it was supplied additionally # determine v6 port, supposed it was supplied additionally
if [[ -n "$tmp_port" ]]; then if [[ -n "$tmp_port" ]]; then
@ -7951,14 +7951,14 @@ parse_hn_port() {
NODE=$(sed -e 's/\[//' -e 's/\]//' <<< "$NODE") NODE=$(sed -e 's/\[//' -e 's/\]//' <<< "$NODE")
else else
# determine v4 port, supposed it was supplied additionally # determine v4 port, supposed it was supplied additionally
echo "$NODE" | grep -q ':' && \ grep -q ':' <<< "$NODE" && \
PORT=$(echo "$NODE" | sed 's/^.*\://') && NODE=$(echo "$NODE" | sed 's/\:.*$//') PORT=$(sed 's/^.*\://' <<< "$NODE") && NODE=$(sed 's/\:.*$//' <<< "$NODE")
fi fi
debugme echo $NODE:$PORT debugme echo $NODE:$PORT
SNI="-servername $NODE" SNI="-servername $NODE"
URL_PATH=$(echo "$1" | sed 's/https:\/\///' | sed 's/'"${NODE}"'//' | sed 's/.*'"${PORT}"'//') # remove protocol and node part and port URL_PATH=$(sed 's/https:\/\///' <<< "$1" | sed 's/'"${NODE}"'//' | sed 's/.*'"${PORT}"'//') # remove protocol and node part and port
URL_PATH=$(echo "$URL_PATH" | sed 's/\/\//\//g') # we rather want // -> / URL_PATH=$(sed 's/\/\//\//g' <<< "$URL_PATH") # we rather want // -> /
[[ -z "$URL_PATH" ]] && URL_PATH="/" [[ -z "$URL_PATH" ]] && URL_PATH="/"
debugme echo $URL_PATH debugme echo $URL_PATH
return 0 # NODE, URL_PATH, PORT is set now return 0 # NODE, URL_PATH, PORT is set now
@ -8660,7 +8660,7 @@ parse_opt_equal_sign() {
echo ${1#*=} echo ${1#*=}
return 1 # = means we don't need to shift args! return 1 # = means we don't need to shift args!
else else
echo $2 echo "$2"
return 0 # we need to shift return 0 # we need to shift
fi fi
} }
@ -9099,6 +9099,7 @@ if $do_display_only; then
fi fi
if $do_mass_testing; then if $do_mass_testing; then
prepare_logging
run_mass_testing run_mass_testing
exit $? exit $?
fi fi
@ -9145,4 +9146,4 @@ fi
exit $? exit $?
# $Id: testssl.sh,v 1.571 2017/02/24 15:30:28 dirkw Exp $ # $Id: testssl.sh,v 1.572 2017/03/23 15:19:22 dirkw Exp $