From 85182847957497ca4766445e34df5ee7ecf1c8da Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Tue, 14 Jan 2020 18:55:09 +0100 Subject: [PATCH] Try temp file creation in a different location ... if the standard directory /tmp is not allowed to write to. As noted in #1273 this might be the case for Termux on Android. --- testssl.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/testssl.sh b/testssl.sh index 0d07341..c6a55f2 100755 --- a/testssl.sh +++ b/testssl.sh @@ -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"