Date: Fri, 14 Nov 2003 15:52:48 +0100 From: Karl Eichwalder To: htdig-dev@lists.sourceforge.net Subject: [htdig-dev] Use mktemp in %post of .spec Avoid predictable filenames in /tmp. Fri Nov 14 15:46:33 2003 Karl Eichwalder * 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 <