~ubuntu-branches/ubuntu/hoary/apache2/hoary-security

« back to all changes in this revision

Viewing changes to debian/patches/039_fix_forensic_tmpfiles

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-04-01 16:30:56 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050401163056-ve71h4qd7f4plu7j
Tags: 2.0.53-5ubuntu5
Fix the init script to not exit with an error when asked to
stop a daemon that isn't running (Was the root cause of #8374)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -ruN -x configure -x '*~' -x build-tree.orig -x '*.rej' build-tree.orig/apache2/support/check_forensic build-tree/apache2/support/check_forensic
 
2
--- build-tree.orig/apache2/support/check_forensic      2004-04-12 18:32:16.000000000 +0100
 
3
+++ build-tree/apache2/support/check_forensic   2005-01-18 12:12:10.634412064 +0000
 
4
@@ -7,9 +7,15 @@
 
5
 
 
6
 F=$1
 
7
 
 
8
-cut -f 1 -d '|' $F  > /tmp/fc-all.$$
 
9
-grep + < /tmp/fc-all.$$ | cut -c2- | sort > /tmp/fc-in.$$
 
10
-grep -- - < /tmp/fc-all.$$ | cut -c2- | sort > /tmp/fc-out.$$
 
11
+all=`mktemp -t fcall.XXXXXX || tempfile --prefix=fcall` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
 
12
+in=`mktemp -t fcin.XXXXXX || tempfile --prefix=fcin` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
 
13
+out=`mktemp -t fcout.XXXXXX || tempfile --prefix=fcout` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
 
14
+trap "rm -f -- \"$all\" \"$in\" \"$out\";" 0 1 2 3 13 15
 
15
+
 
16
+cut -f 1 -d '|' $F  > $all
 
17
+grep + < $all | cut -c2- | sort > $in
 
18
+grep -- - < $all | cut -c2- | sort > $out
 
19
+
 
20
 # use -i instead of -I for GNU xargs
 
21
-join -v 1 /tmp/fc-in.$$ /tmp/fc-out.$$ | xargs -I xx egrep "^\\+xx" $F
 
22
-rm /tmp/fc-all.$$ /tmp/fc-in.$$ /tmp/fc-out.$$
 
23
+join -v 1 $in $out | xargs -i xx egrep "^\\+xx" $F
 
24
+exit 0