1
0
mirror of https://github.com/drwetter/testssl.sh.git synced 2025-05-29 03:17:04 +02:00

Try temp file creation in a different location

... if the standard directory /tmp is not allowed to write to.
As noted in  this might be the case for Termux on Android.
This commit is contained in:
Dirk Wetter 2020-01-14 18:55:09 +01:00
parent 6378371baa
commit 8518284795

@ -17194,7 +17194,12 @@ EOF
}
maketempf() {
TEMPDIR=$(mktemp -d /tmp/testssl.XXXXXX) || exit $ERR_FCREATE
TEMPDIR=$(mktemp -d /tmp/testssl.XXXXXX)
if [[ $? -ne 0 ]]; then
# for e.g. devices where we can't write to /tmp:
TEMPPATH=$PWD
TEMPDIR=$(mktemp -d $PWD/testssl.XXXXXX) || exit $ERR_FCREATE
fi
TMPFILE=$TEMPDIR/tempfile.txt || exit $ERR_FCREATE
if [[ "$DEBUG" -eq 0 ]]; then
ERRFILE="/dev/null"