From 381ad3de324144a408c2e38a54757c6cec0dcb3b Mon Sep 17 00:00:00 2001 From: David Cooper Date: Thu, 6 Apr 2017 11:26:03 -0400 Subject: [PATCH] Handle word splitting of log file names. This PR fixes a problem that occurs if log file names include spaces. --- testssl.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/testssl.sh b/testssl.sh index 9c2fc56..4a99e0f 100755 --- a/testssl.sh +++ b/testssl.sh @@ -11025,13 +11025,13 @@ prepare_logging() { fi if ! "$APPEND"; then - [[ -e $LOGFILE ]] && outln && fatal "\"$LOGFILE\" exists. Either use \"--append\" or (re)move it" 1 + [[ -e "$LOGFILE" ]] && outln && fatal "\"$LOGFILE\" exists. Either use \"--append\" or (re)move it" 1 fi - tmln_out "## Scan started as: \"$PROG_NAME $CMDLINE\"" >>${LOGFILE} - tmln_out "## at $HNAME:$OPENSSL_LOCATION" >>${LOGFILE} - tmln_out "## version testssl: $VERSION ${GIT_REL_SHORT:-$CVS_REL_SHORT} from $REL_DATE" >>${LOGFILE} - tmln_out "## version openssl: \"$OSSL_VER\" from \"$OSSL_BUILD_DATE\")\n" >>${LOGFILE} - exec > >(tee -a ${LOGFILE}) + tmln_out "## Scan started as: \"$PROG_NAME $CMDLINE\"" >>"$LOGFILE" + tmln_out "## at $HNAME:$OPENSSL_LOCATION" >>"$LOGFILE" + tmln_out "## version testssl: $VERSION ${GIT_REL_SHORT:-$CVS_REL_SHORT} from $REL_DATE" >>"$LOGFILE" + tmln_out "## version openssl: \"$OSSL_VER\" from \"$OSSL_BUILD_DATE\")\n" >>"$LOGFILE" + exec > >(tee -a "$LOGFILE") }