From 8e517e0a702f0c1f0ff336b64e7faba170e9ac0d Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Sat, 23 Dec 2023 12:58:05 +0100 Subject: [PATCH] Bail out if user error bc of umask If a user chose a broken umask testssl.sh will start but emits subsequent errors. This patch adds two sanity checks whether it is allowed to create and read files in the temp directory. Fixes #2449 --- testssl.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index 6b694e4..acd0904 100755 --- a/testssl.sh +++ b/testssl.sh @@ -20518,7 +20518,9 @@ maketempf() { fi TEMPDIR=$(mktemp -d "$PWD/testssl.XXXXXX") || exit $ERR_FCREATE fi - TMPFILE=$TEMPDIR/tempfile.txt || exit $ERR_FCREATE + ls "$TEMPDIR/" 2>/dev/null || fatal "temporary directory needed not readeable" $ERR_FCREATE + TMPFILE=$TEMPDIR/tempfile.txt + touch $TEMPFILE 2>/dev/null || fatal "temporary directory needed not writeable" $ERR_FCREATE if [[ "$DEBUG" -eq 0 ]]; then ERRFILE="/dev/null" else