You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by th...@apache.org on 2005/01/18 13:27:13 UTC
svn commit: r125495 - /httpd/httpd/trunk/CHANGES /httpd/httpd/trunk/support/check_forensic
Author: thommay
Date: Tue Jan 18 04:27:12 2005
New Revision: 125495
URL: http://svn.apache.org/viewcvs?view=rev&rev=125495
Log:
support/check_forensic: Fix temp file usage
Submitted By: Javier Fernandez-Sanguino Pen~a
Reviewed By: Thom May
Modified:
httpd/httpd/trunk/CHANGES
httpd/httpd/trunk/support/check_forensic
Modified: httpd/httpd/trunk/CHANGES
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/CHANGES?view=diff&rev=125495&p1=httpd/httpd/trunk/CHANGES&r1=125494&p2=httpd/httpd/trunk/CHANGES&r2=125495
==============================================================================
--- httpd/httpd/trunk/CHANGES (original)
+++ httpd/httpd/trunk/CHANGES Tue Jan 18 04:27:12 2005
@@ -2,6 +2,9 @@
[Remove entries to the current 2.0 section below, when backported]
+ *) support/check_forensic: Fix temp file usage
+ [Javier Fernandez-Sanguino Pen~a <jfs computer.org>]
+
*) mod_ssl: Add SSLCADNRequestFile and SSLCADNRequestPath directives
which can be used to configure a specific list of CA names to send
in a client certificate request. PR 32848.
Modified: httpd/httpd/trunk/support/check_forensic
Url: http://svn.apache.org/viewcvs/httpd/httpd/trunk/support/check_forensic?view=diff&rev=125495&p1=httpd/httpd/trunk/support/check_forensic&r1=125494&p2=httpd/httpd/trunk/support/check_forensic&r2=125495
==============================================================================
--- httpd/httpd/trunk/support/check_forensic (original)
+++ httpd/httpd/trunk/support/check_forensic Tue Jan 18 04:27:12 2005
@@ -7,9 +7,15 @@
F=$1
-cut -f 1 -d '|' $F > /tmp/fc-all.$$
-grep + < /tmp/fc-all.$$ | cut -c2- | sort > /tmp/fc-in.$$
-grep -- - < /tmp/fc-all.$$ | cut -c2- | sort > /tmp/fc-out.$$
+all=`mktemp -t fcall.XXXXXX || tempfile --prefix=fcall` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
+in=`mktemp -t fcin.XXXXXX || tempfile --prefix=fcin` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
+out=`mktemp -t fcout.XXXXXX || tempfile --prefix=fcout` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
+trap "rm -f -- \"$all\" \"$in\" \"$out\";" 0 1 2 3 13 15
+
+cut -f 1 -d '|' $F > $all
+grep + < $all | cut -c2- | sort > $in
+grep -- - < $all | cut -c2- | sort > $out
+
# use -i instead of -I for GNU xargs
-join -v 1 /tmp/fc-in.$$ /tmp/fc-out.$$ | xargs -I xx egrep "^\\+xx" $F
-rm /tmp/fc-all.$$ /tmp/fc-in.$$ /tmp/fc-out.$$
+join -v 1 $in $out | xargs -I xx egrep "^\\+xx" $F
+exit 0