summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2012-04-15 08:06:19 +0000
committerXavier Roche <xroche@users.noreply.github.com>2012-04-15 08:06:19 +0000
commit3240e0aae2aa095b5855d5bfd9cc51932610fbc7 (patch)
treed47e8b6462126fafddc33c809b13b0ee480d84ca
parent3908bcde0b032512c3a516524c4010e7df5af3fe (diff)
Do not use md5sum to produce a temporary filename, but mktemp
* patch by Ryan Schmidt <ryandesign@macports.org>
-rwxr-xr-xsrc/webhttrack3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/webhttrack b/src/webhttrack
index dfb7dba..bf3cb08 100755
--- a/src/webhttrack
+++ b/src/webhttrack
@@ -161,8 +161,7 @@ exit $?
fi
# Create a temporary filename
-TMPSRVFILE="/tmp/.webhttrack.$$.`head -c16 /dev/random | md5sum | cut -f1 -d' '`"
->${TMPSRVFILE} || ! log "cound not create the temporary file ${TMPSRVFILE}" || exit 1
+TMPSRVFILE="$(mktemp ${TMPDIR:-/tmp}/.webhttrack.XXXXXXXX)" || ! log "cound not create the temporary file ${TMPSRVFILE}" || exit 1
# Launch htsserver binary and setup the server
(${BINPATH}/htsserver "${DISTPATH}/" path "${HOME}/websites" lang "${LANGN}" $@; echo SRVURL=error) > ${TMPSRVFILE}&
# Find the generated SRVURL