|
From: Karl E. <ke...@su...> - 2003-11-14 14:52:52
|
Avoid predictable filenames in /tmp.
Fri Nov 14 15:46:33 2003 Karl Eichwalder <ke...@su...>
* contrib/htdig-3.2.0.spec (%post): Use 'mktemp'.
--- htdig-3.2.0b5/contrib/htdig-3.2.0.spec.~1~ 2002-02-01 23:49:28.000000000 +0100
+++ htdig-3.2.0b5/contrib/htdig-3.2.0.spec 2003-11-14 15:46:06.000000000 +0100
@@ -54,10 +54,11 @@
SERVERNAME="`grep '^ServerName' /etc/httpd/conf/httpd.conf | awk 'NR == 1 {print $2}'`"
[ -z "$SERVERNAME" ] && SERVERNAME="`hostname -f`"
[ -z "$SERVERNAME" ] && SERVERNAME="localhost"
+ TMPFILE=$(mktemp /tmp/ht.XXXXXX) || exit 1
sed 's/^start_url:.*/#&\
-# (See end of file for this parameter.)/' /etc/htdig/htdig.conf > /tmp/ht.$$
- cat /tmp/ht.$$ > /etc/htdig/htdig.conf
- rm /tmp/ht.$$
+# (See end of file for this parameter.)/' /etc/htdig/htdig.conf > $TMPFILE
+ cat $TMPFILE > /etc/htdig/htdig.conf
+ rm $TMPFILE
cat >> /etc/htdig/htdig.conf <<!
# Automatically set up by htdig RPM, from your current Apache httpd.conf...
Diff finished at Fri Nov 14 15:49:03
|