tags 333305 + pending
thanks

I have prepared an NMU for thttpd that fixes this bug and many others (11
bugs are closed in the changelog).

Most of the bugs are really important, even though not all of them were
severity: important.

I'm attaching the full interdiff output for the changes that I've applied.
As you might see, for 11 bugs in the closing, it's a short diff.

I'm going to upload to the 5-day delayed queue, in order to allow the other
NMU to go into testing before this one is in unstable.

I'm also going to notify the other bugs about the Intent to NMU, but I'm
only going to attach the patch for this one.

-- 
Love,
        Marga.
diff -u thttpd-2.23beta1/libhttpd.c thttpd-2.23beta1/libhttpd.c
--- thttpd-2.23beta1/libhttpd.c
+++ thttpd-2.23beta1/libhttpd.c
@@ -77,6 +77,10 @@
 # endif
 #endif
 
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+
 extern char* crypt( const char* key, const char* setting );
 
 #include "libhttpd.h"
diff -u thttpd-2.23beta1/thttpd.c thttpd-2.23beta1/thttpd.c
--- thttpd-2.23beta1/thttpd.c
+++ thttpd-2.23beta1/thttpd.c
@@ -63,6 +63,9 @@
 #define SHUT_WR 1
 #endif
 
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
 
 static char* argv0;
 static int debug;
diff -u thttpd-2.23beta1/debian/prerm thttpd-2.23beta1/debian/prerm
--- thttpd-2.23beta1/debian/prerm
+++ thttpd-2.23beta1/debian/prerm
@@ -7,7 +7,11 @@
                #
                #       Stop the daemon
                #
-               invoke-rc.d thttpd stop
+               if [ -x /usr/sbin/invoke-rc.d ]; then
+                       invoke-rc.d thttpd stop
+               else
+                       /etc/init.d/thttpd stop
+               fi
                [ -L /usr/doc/thttpd ] && rm -f /usr/doc/thttpd
                ;;
        failed-upgrade)
diff -u thttpd-2.23beta1/debian/changelog thttpd-2.23beta1/debian/changelog
--- thttpd-2.23beta1/debian/changelog
+++ thttpd-2.23beta1/debian/changelog
@@ -1,3 +1,22 @@
+thttpd (2.23beta1-4.2) unstable; urgency=low
+
+  * Non-maintainer upload to fix a policy issue and other bugs.
+  * Patched config, postinst, prerm and logrotate so that invoke-rc.d is used
+    whenever needed.  Also fixed problems with redirecting stderr.
+    Thanks to Rodrigo Campos for the patch.
+    (Closes: #333305, #237617)
+  * Patched libhttpd.c and thttpd.c so that MAXPATHLEN gets define in Hurd.
+    Thanks to Michael Banck for the patch.  (Closes: #308681)
+  * Added check to be sure that the PIDFILE is not a stale file. Thanks to
+    Bastian Kleineidam for the patch.  
+    (Closes: #385055, #334610, #247930, #384738)
+  * Added a "sleep 1" line in the restart option of the init script.
+    (Closes: #236329, #379850, #301719)
+  * Added quotes to debian/config test for the PORT variable, to fix problems
+    with IPv6 ports. (Closes: #350960)
+
+ -- Margarita Manterola <[EMAIL PROTECTED]>  Sat,  9 Sep 2006 03:39:45 -0300
+
 thttpd (2.23beta1-4.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -u thttpd-2.23beta1/debian/postinst thttpd-2.23beta1/debian/postinst
--- thttpd-2.23beta1/debian/postinst
+++ thttpd-2.23beta1/debian/postinst
@@ -7,7 +7,11 @@
                echo "Updating rc.d symbolic links to start thttpd upon 
booting."
                update-rc.d thttpd defaults 20 > /dev/null
                echo "Starting thttpd ..."
-               /etc/init.d/thttpd start  > /dev/null || true
+               if [ -x /usr/sbin/invoke-rc.d ]; then
+                       invoke-rc.d thttpd start  > /dev/null || true
+               else
+                       /etc/init.d/thttpd start  > /dev/null || true
+               fi              
                ;;
        *)
                #
diff -u thttpd-2.23beta1/debian/config thttpd-2.23beta1/debian/config
--- thttpd-2.23beta1/debian/config
+++ thttpd-2.23beta1/debian/config
@@ -97,7 +97,7 @@
     db_get thttpd/select_port
     PORT=$RET
 
-    if [ -z $PORT ]; then
+    if [ -z "$PORT" ]; then
         PORT=$DEFPORT
     fi
 }
@@ -120,7 +120,11 @@
 
 if [ "$INSTALL_STAT" = "installed" ]; then
     if [ -x /etc/init.d/thttpd ]; then
-        /etc/init.d/thttpd stop 1>&2> /dev/null || true
+        if [ -x /usr/sbin/invoke-rc.d ]; then
+            invoke-rc.d thttpd stop > /dev/null 2>&1 || true
+        else
+            /etc/init.d/thttpd stop > /dev/null 2>&1 || true
+        fi
     fi
 fi
 
diff -u thttpd-2.23beta1/debian/thttpd.rc thttpd-2.23beta1/debian/thttpd.rc
--- thttpd-2.23beta1/debian/thttpd.rc
+++ thttpd-2.23beta1/debian/thttpd.rc
@@ -23,7 +23,14 @@
     start)
         echo -n "Starting web server: "
         if [ -f $PIDFILE ]; then
-            echo "$DAEMON already running."
+            PID=`cat $PIDFILE`
+            if ps ax | grep -q "^$PID"; then
+                echo "$DAEMON already running."
+            else
+                rm -f $PIDFILE
+                $DAEMON -C $CONFFILE -i $PIDFILE
+                echo "$NAME. "
+            fi
         else
             $DAEMON -C $CONFFILE -i $PIDFILE
             echo "$NAME. "
@@ -32,8 +39,13 @@
     stop)
         echo -n "Stopping web server: "
         if [ -f $PIDFILE ]; then
-            kill -10 `cat $PIDFILE`
-            echo "$NAME"
+            PID=`cat $PIDFILE`
+            if ps ax | grep -q "^$PID"; then
+                kill -10 $PID
+                echo "$NAME"
+            else
+                echo "No $DAEMON found running; none killed."
+            fi
             rm -f $PIDFILE
         else
             echo "No $DAEMON found running; none killed."
@@ -42,8 +54,13 @@
     force-stop)
         echo -n "Terminating web server: "
         if [ -f $PIDFILE ]; then
-            kill -10 `cat $PIDFILE`
-            echo "$NAME"
+            PID=`cat $PIDFILE`
+            if ps ax | grep -q "^$PID"; then
+                kill -10 $PID
+                echo "$NAME"
+            else
+                echo "No $DAEMON found running; none killed."
+            fi
             rm -f $PIDFILE
         else
             echo "No $DAEMON found running; none killed."
@@ -51,6 +68,7 @@
         ;;
     restart|force-reload)
         $INIT stop 
+        sleep 1 
         $INIT start
         ;;
     *)
diff -u thttpd-2.23beta1/debian/thttpd.logrotate 
thttpd-2.23beta1/debian/thttpd.logrotate
--- thttpd-2.23beta1/debian/thttpd.logrotate
+++ thttpd-2.23beta1/debian/thttpd.logrotate
@@ -11,7 +11,11 @@
     endscript
     postrotate
        if [ -f /tmp/start_thttpd ]; then
-           /etc/init.d/thttpd restart 2>&1 > /dev/null
+               if [ -x /usr/sbin/invoke-rc.d ]; then
+                       invoke-rc.d thttpd restart > /dev/null 2>&1
+               else
+                       /etc/init.d/thttpd restart > /dev/null 2>&1
+               fi
            rm -f /tmp/start_thttpd
        fi
     endscript

Reply via email to