Skip to content

Commit

Permalink
Bail out if user error bc of umask
Browse files Browse the repository at this point in the history
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 23, 2023
1 parent 1a9a486 commit 8e517e0
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 @@ -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

Check failure on line 20521 in testssl.sh

View workflow job for this annotation

GitHub Actions / Check for spelling errors

readeable ==> readable

Check failure on line 20521 in testssl.sh

View workflow job for this annotation

GitHub Actions / Check for spelling errors

readeable ==> readable
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
Expand Down

0 comments on commit 8e517e0

Please sign in to comment.