]> source.dussan.org Git - rspamd.git/commitdiff
Use mktemp when available
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 30 Nov 2015 13:33:22 +0000 (13:33 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 30 Nov 2015 13:33:22 +0000 (13:33 +0000)
dist.sh

diff --git a/dist.sh b/dist.sh
index e2ecd8e19aeae6b264cf53f4cc15fb80ecd8c07a..6e10cae2f6d0a8015fd2f1a845cc6bbcc1d1517f 100755 (executable)
--- a/dist.sh
+++ b/dist.sh
@@ -12,7 +12,13 @@ PREFIX=`basename $FNAME | sed -e 's/\.tar.*$//'`
 
 OUT=""
 while true ; do
-       OUT="/tmp/files-`strings -7 /dev/urandom | head -1 | sed -e 's/[^[:alnum:]]//g'`"
+       _mktemp=`which mktemp`
+       if [ F"$_mktemp" != "F" ] ; then
+               OUT=`$_mktemp /tmp/files-XXXXXXXX`
+               break
+       else
+               OUT="/tmp/files-`strings -7 /dev/urandom | head -1 | sed -e 's/[^[:alnum:]]//g'`"
+       fi
        if [ ! -f "$OUT" ] ; then break ; fi
 done