~ubuntu-branches/ubuntu/maverick/tomcat6/maverick

« back to all changes in this revision

Viewing changes to debian/patches/allow-empty-pid-file.patch

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2010-06-28 21:41:31 UTC
  • mfrom: (2.2.15 sid)
  • Revision ID: james.westby@ubuntu.com-20100628214131-3wktukpb3lgdf83h
Tags: 6.0.26-5
* Convert patches to dep3 format.
* Backport security fix from trunk to fix CVE-2010-1157. (Closes: #587447)
* Set urgency to medium due to the security fix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--- a/bin/catalina.sh
2
 
+++ b/bin/catalina.sh
3
 
@@ -305,7 +305,7 @@
4
 
 elif [ "$1" = "start" ] ; then
5
 
 
6
 
   if [ ! -z "$CATALINA_PID" ]; then
7
 
-    if [ -f "$CATALINA_PID" ]; then
8
 
+    if [ -s "$CATALINA_PID" ]; then
9
 
       echo "PID file ($CATALINA_PID) found. Is Tomcat still running? Start aborted."
10
 
       exit 1
11
 
     fi
12
 
@@ -363,12 +363,16 @@
13
 
   fi
14
 
 
15
 
   if [ ! -z "$CATALINA_PID" ]; then
16
 
-    if [ -f "$CATALINA_PID" ]; then
17
 
+    if [ -s "$CATALINA_PID" ]; then
18
 
       kill -0 `cat $CATALINA_PID` >/dev/null 2>&1
19
 
       if [ $? -eq 1 ]; then
20
 
         echo "PID file ($CATALINA_PID) found but no matching process was found. Stop aborted."
21
 
         exit 1
22
 
       fi
23
 
+    elif [ -f "$CATALINA_PID" ]; then
24
 
+        rm $CATALINA_PID
25
 
+        echo "\$CATALINA_PID was set ($CATALINA_PID) but the specified file is empty. Did Tomcat fail while starting? Stop aborted."
26
 
+        exit 1
27
 
     else
28
 
       echo "\$CATALINA_PID was set ($CATALINA_PID) but the specified file does not exist. Is Tomcat running? Stop aborted."
29
 
       exit 1