Skip to content

Commit

Permalink
Bail out if user error bc of umask (3.0 branch)
Browse files Browse the repository at this point in the history
Implemnation for 3.0, 3.2 see #2450

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
  • Loading branch information
drwetter committed Dec 24, 2023
1 parent 68dec54 commit 02220d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion testssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17555,7 +17555,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 readable" $ERR_FCREATE
TMPFILE=$TEMPDIR/tempfile.txt
touch $TMPFILE 2>/dev/null || fatal "temporary directory needed not writeable" $ERR_FCREATE
if [[ "$DEBUG" -eq 0 ]]; then
ERRFILE="/dev/null"
else
Expand Down

0 comments on commit 02220d2

Please sign in to comment.