mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-03 23:39:45 +01:00
fix for filename output beginnng with .
There was an error in e450eb34e4
which addressed #846 which lead to the problem that an output filename
could start with a "." if no FNAME_PREFiX and if just --html, --csv
or --log or --json* was supplied.
This commit fixes the problem.
This commit is contained in:
parent
98f4f28017
commit
fb3aa6ad7f
18
testssl.sh
18
testssl.sh
@ -849,11 +849,11 @@ json_header() {
|
|||||||
elif "$do_mass_testing"; then
|
elif "$do_mass_testing"; then
|
||||||
:
|
:
|
||||||
elif "$do_mx_all_ips"; then
|
elif "$do_mx_all_ips"; then
|
||||||
fname_prefix="${FNAME_PREFIX}.mx-${URI}"
|
fname_prefix="${FNAME_PREFIX}mx-${URI}"
|
||||||
else
|
else
|
||||||
! "$filename_provided" && [[ -z "$NODE" ]] && parse_hn_port "${URI}"
|
! "$filename_provided" && [[ -z "$NODE" ]] && parse_hn_port "${URI}"
|
||||||
# NODE, URL_PATH, PORT, IPADDR and IP46ADDR is set now --> wrong place
|
# NODE, URL_PATH, PORT, IPADDR and IP46ADDR is set now --> wrong place
|
||||||
fname_prefix="${FNAME_PREFIX}.${NODE}"_p"${PORT}"
|
fname_prefix="${FNAME_PREFIX}${NODE}"_p"${PORT}"
|
||||||
fi
|
fi
|
||||||
if [[ -z "$JSONFILE" ]]; then
|
if [[ -z "$JSONFILE" ]]; then
|
||||||
JSONFILE="$fname_prefix-$(date +"%Y%m%d-%H%M".json)"
|
JSONFILE="$fname_prefix-$(date +"%Y%m%d-%H%M".json)"
|
||||||
@ -888,11 +888,11 @@ csv_header() {
|
|||||||
elif "$do_mass_testing"; then
|
elif "$do_mass_testing"; then
|
||||||
:
|
:
|
||||||
elif "$do_mx_all_ips"; then
|
elif "$do_mx_all_ips"; then
|
||||||
fname_prefix="${FNAME_PREFIX}.mx-$URI"
|
fname_prefix="${FNAME_PREFIX}mx-$URI"
|
||||||
else
|
else
|
||||||
! "$filename_provided" && [[ -z "$NODE" ]] && parse_hn_port "${URI}"
|
! "$filename_provided" && [[ -z "$NODE" ]] && parse_hn_port "${URI}"
|
||||||
# NODE, URL_PATH, PORT, IPADDR and IP46ADDR is set now --> wrong place
|
# NODE, URL_PATH, PORT, IPADDR and IP46ADDR is set now --> wrong place
|
||||||
fname_prefix="${FNAME_PREFIX}.${NODE}"_p"${PORT}"
|
fname_prefix="${FNAME_PREFIX}${NODE}"_p"${PORT}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$CSVFILE" ]]; then
|
if [[ -z "$CSVFILE" ]]; then
|
||||||
@ -931,11 +931,11 @@ html_header() {
|
|||||||
elif "$do_mass_testing"; then
|
elif "$do_mass_testing"; then
|
||||||
:
|
:
|
||||||
elif "$do_mx_all_ips"; then
|
elif "$do_mx_all_ips"; then
|
||||||
fname_prefix="${FNAME_PREFIX}.mx-$URI"
|
fname_prefix="${FNAME_PREFIX}mx-$URI"
|
||||||
else
|
else
|
||||||
! "$filename_provided" && [[ -z "$NODE" ]] && parse_hn_port "${URI}"
|
! "$filename_provided" && [[ -z "$NODE" ]] && parse_hn_port "${URI}"
|
||||||
# NODE, URL_PATH, PORT, IPADDR and IP46ADDR is set now --> wrong place
|
# NODE, URL_PATH, PORT, IPADDR and IP46ADDR is set now --> wrong place
|
||||||
fname_prefix="${FNAME_PREFIX}.${NODE}"_p"${PORT}"
|
fname_prefix="${FNAME_PREFIX}${NODE}"_p"${PORT}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$HTMLFILE" ]]; then
|
if [[ -z "$HTMLFILE" ]]; then
|
||||||
@ -13207,7 +13207,7 @@ prepare_logging() {
|
|||||||
"$do_mass_testing" && ! "$filename_provided" && return 0
|
"$do_mass_testing" && ! "$filename_provided" && return 0
|
||||||
"$CHILD_MASS_TESTING" && "$filename_provided" && return 0
|
"$CHILD_MASS_TESTING" && "$filename_provided" && return 0
|
||||||
|
|
||||||
[[ -z "$fname_prefix" ]] && fname_prefix="${FNAME_PREFIX}.${NODE}"_p"${PORT}"
|
[[ -z "$fname_prefix" ]] && fname_prefix="${FNAME_PREFIX}${NODE}"_p"${PORT}"
|
||||||
|
|
||||||
if [[ -z "$LOGFILE" ]]; then
|
if [[ -z "$LOGFILE" ]]; then
|
||||||
LOGFILE="$fname_prefix-$(date +"%Y%m%d-%H%M".log)"
|
LOGFILE="$fname_prefix-$(date +"%Y%m%d-%H%M".log)"
|
||||||
@ -13846,7 +13846,7 @@ run_mx_all_ips() {
|
|||||||
if [[ -n "$LOGFILE" ]]; then
|
if [[ -n "$LOGFILE" ]]; then
|
||||||
prepare_logging
|
prepare_logging
|
||||||
else
|
else
|
||||||
prepare_logging "${FNAME_PREFIX}.mx-$1"
|
prepare_logging "${FNAME_PREFIX}mx-$1"
|
||||||
fi
|
fi
|
||||||
if [[ -n "$mxs" ]] && [[ "$mxs" != ' ' ]]; then
|
if [[ -n "$mxs" ]] && [[ "$mxs" != ' ' ]]; then
|
||||||
[[ $mxport == "465" ]] && \
|
[[ $mxport == "465" ]] && \
|
||||||
@ -14796,7 +14796,7 @@ parse_cmd_line() {
|
|||||||
;;
|
;;
|
||||||
--outprefix)
|
--outprefix)
|
||||||
FNAME_PREFIX="$(parse_opt_equal_sign "$1" "$2")"
|
FNAME_PREFIX="$(parse_opt_equal_sign "$1" "$2")"
|
||||||
[[ $? -eq 0 ]] && shift
|
[[ $? -eq 0 ]] && shift && FNAME_PREFIX="${FNAME_PREFIX}."
|
||||||
;;
|
;;
|
||||||
--openssl|--openssl=*)
|
--openssl|--openssl=*)
|
||||||
OPENSSL="$(parse_opt_equal_sign "$1" "$2")"
|
OPENSSL="$(parse_opt_equal_sign "$1" "$2")"
|
||||||
|
Loading…
Reference in New Issue
Block a user