Tags 391765 + patch pending
Tags 393627 + patch pending
thanks

Hi!

I have prepared an NMU to fix this bug.  It took me a long while, since
not only had the dependency changed, but also the libapr api has changed,
and part of the source code needed to be updated.

Most of the changes made should be sent upstream.

I'm attaching the interdiff output of the changes I made.  There are
changes in the configure and Makefile files, and also changes in the source
code itself.

-- 
Love,
        Marga
diff -u suphp-0.6.1/src/apache/Makefile.in suphp-0.6.1/src/apache/Makefile.in
--- suphp-0.6.1/src/apache/Makefile.in
+++ suphp-0.6.1/src/apache/Makefile.in
@@ -61,6 +61,7 @@
 host_triplet = @host@
 APACHE_VERSION_1_3 = @APACHE_VERSION_1_3@
 APACHE_VERSION_2 = @APACHE_VERSION_2@
+APR_EXTRA_CFLAGS = @APR_EXTRA_CFLAGS@
 APR_INCLUDEDIR = @APR_INCLUDEDIR@
 APXS = @APXS@
 APXS_EXTRA_CFLAGS = @APXS_EXTRA_CFLAGS@
diff -u suphp-0.6.1/src/apache2/mod_suphp.c suphp-0.6.1/src/apache2/mod_suphp.c
--- suphp-0.6.1/src/apache2/mod_suphp.c
+++ suphp-0.6.1/src/apache2/mod_suphp.c
@@ -29,6 +29,7 @@
 #include "http_config.h"
 #include "http_core.h"
 #include "http_log.h"
+#include "http_request.h"
 
 #include "util_script.h"
 #include "util_filter.h"
@@ -56,7 +57,7 @@
         return -1;
        
     rv = apr_bucket_read(b, &bucket_data, &bucket_data_len, APR_BLOCK_READ);
-    if (!APR_STATUS_IS_SUCCESS(rv) || (bucket_data_len == 0))
+    if (rv != APR_SUCCESS || (bucket_data_len == 0))
     {
         return 0;
     }
@@ -558,8 +559,9 @@
             return rv;
         }
         
-        APR_BRIGADE_FOREACH(bucket, bb)
-        {
+        bucket = APR_BRIGADE_FIRST(bb);
+               while (!APR_BRIGADE_EMPTY(bb)) 
+               {
             const char *data;
             apr_size_t len;
             int child_stopped_reading = 0;
@@ -582,6 +584,7 @@
             {
                 child_stopped_reading = 1;
             }
+                       bucket = APR_BUCKET_NEXT(bucket);
         }
         apr_brigade_cleanup(bb);
     }
@@ -634,12 +637,14 @@
             
             const char *buf;
             apr_size_t blen;
-            APR_BRIGADE_FOREACH(b, bb)
+                       b = APR_BRIGADE_FIRST(bb);
+            while (b != APR_BRIGADE_SENTINEL(bb)) 
             {
                 if (APR_BUCKET_IS_EOS(b))
                     break;
                 if (apr_bucket_read(b, &buf, &blen, APR_BLOCK_READ) != 
APR_SUCCESS)
                     break;
+                               b = APR_BUCKET_NEXT(b);
             }
             apr_brigade_destroy(bb);
             suphp_log_script_err(r, proc->err);
@@ -655,12 +660,14 @@
             /* empty brigade (script output) */
             const char *buf;
             apr_size_t blen;
-            APR_BRIGADE_FOREACH(b, bb)
+                       b = APR_BRIGADE_FIRST(bb);
+            while (b != APR_BRIGADE_SENTINEL(bb)) 
             {
                 if (APR_BUCKET_IS_EOS(b))
                     break;
                 if (apr_bucket_read(b, &buf, &blen, APR_BLOCK_READ) != 
APR_SUCCESS)
                     break;
+                               b = APR_BUCKET_NEXT(b);
             }
             apr_brigade_destroy(bb);
             return HTTP_MOVED_TEMPORARILY;
diff -u suphp-0.6.1/src/apache2/Makefile.in suphp-0.6.1/src/apache2/Makefile.in
--- suphp-0.6.1/src/apache2/Makefile.in
+++ suphp-0.6.1/src/apache2/Makefile.in
@@ -61,6 +61,7 @@
 host_triplet = @host@
 APACHE_VERSION_1_3 = @APACHE_VERSION_1_3@
 APACHE_VERSION_2 = @APACHE_VERSION_2@
+APR_EXTRA_CFLAGS = @APR_EXTRA_CFLAGS@
 APR_INCLUDEDIR = @APR_INCLUDEDIR@
 APXS = @APXS@
 APXS_EXTRA_CFLAGS = @APXS_EXTRA_CFLAGS@
@@ -92,7 +93,7 @@
 RC = @RC@
 STRIP = @STRIP@
 VERSION = @VERSION@
-AM_CFLAGS = [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ @APXS_EXTRA_CFLAGS@ 
-DSUPHP_PATH_TO_SUPHP=\"${sbindir}/suphp\" $(DEFINE_USERGROUP)
+AM_CFLAGS = [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ @APXS_EXTRA_CFLAGS@ 
@APR_EXTRA_CFLAGS@ -DSUPHP_PATH_TO_SUPHP=\"${sbindir}/suphp\" 
$(DEFINE_USERGROUP)
 
 noinst_LTLIBRARIES = mod_suphp.la
 mod_suphp_la_SOURCES = mod_suphp.c
diff -u suphp-0.6.1/src/Makefile.in suphp-0.6.1/src/Makefile.in
--- suphp-0.6.1/src/Makefile.in
+++ suphp-0.6.1/src/Makefile.in
@@ -61,6 +61,7 @@
 host_triplet = @host@
 APACHE_VERSION_1_3 = @APACHE_VERSION_1_3@
 APACHE_VERSION_2 = @APACHE_VERSION_2@
+APR_EXTRA_CFLAGS = @APR_EXTRA_CFLAGS@
 APR_INCLUDEDIR = @APR_INCLUDEDIR@
 APXS = @APXS@
 APXS_EXTRA_CFLAGS = @APXS_EXTRA_CFLAGS@
diff -u suphp-0.6.1/configure suphp-0.6.1/configure
--- suphp-0.6.1/configure
+++ suphp-0.6.1/configure
@@ -465,7 +465,7 @@
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME 
PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix 
program_transform_name bindir sbindir libexecdir datadir sysconfdir 
sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir 
build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS 
INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF 
AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC 
EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX build build_cpu build_vendor build_os host 
host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB 
STRIP ac_ct_STRIP CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL APXS 
APACHE_VERSION_1_3 APACHE_VERSION_2 APXS_INCLUDEDIR APXS_LIBEXECDIR 
APXS_EXTRA_CFLAGS APR_INCLUDEDIR OPT_APACHEMOD_USERGROUP_DEF COND_AP13_TRUE 
COND_AP13_FALSE COND_AP20_TRUE COND_AP20_FALSE COND_APUSERGROUP_TRUE 
COND_APUSERGROUP_FALSE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME 
PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix 
program_transform_name bindir sbindir libexecdir datadir sysconfdir 
sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir 
build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS 
INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF 
AUTOMAKE AUTOHEADER MAKEINFO SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC 
EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX build build_cpu build_vendor build_os host 
host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB 
STRIP ac_ct_STRIP CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL APXS 
APACHE_VERSION_1_3 APACHE_VERSION_2 APXS_INCLUDEDIR APXS_LIBEXECDIR 
APXS_EXTRA_CFLAGS APR_INCLUDEDIR APR_EXTRA_CFLAGS OPT_APACHEMOD_USERGROUP_DEF 
COND_AP13_TRUE COND_AP13_FALSE COND_AP20_TRUE COND_AP20_FALSE 
COND_APUSERGROUP_TRUE COND_APUSERGROUP_FALSE LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -18725,7 +18725,7 @@
                     | cut -f2 -d"/" \
                     | cut -f1 -d" "`
     major_version=`echo $APACHE_VERSION|cut -f1,2 -d.`
-    if test "$major_version" = "2.0"; then
+    if test "$major_version" = "2.0" || test "$major_version" = "2.2"; then
       APACHE_VERSION_2=true
       APACHE_VERSION_1_3=false
     else
@@ -18760,6 +18760,8 @@
 if test x"${APACHE_VERSION_2}" = xtrue ; then \
     if test x"${apr_found}" = xyes ; then \
         APR_INCLUDEDIR=`${apr_config} --includedir`
+               APR_EXTRA_CFLAGS=`${apr_config} --cppflags`
+
 
     else
        { { echo "$as_me:$LINENO: error: APR is needed to build mod_suphp for 
Apache 2.x but was not found" >&5
@@ -19660,6 +19662,7 @@
 s,@APXS_LIBEXECDIR@,$APXS_LIBEXECDIR,;t t
 s,@APXS_EXTRA_CFLAGS@,$APXS_EXTRA_CFLAGS,;t t
 s,@APR_INCLUDEDIR@,$APR_INCLUDEDIR,;t t
+s,@APR_EXTRA_CFLAGS@,$APR_EXTRA_CFLAGS,;t t
 s,@OPT_APACHEMOD_USERGROUP_DEF@,$OPT_APACHEMOD_USERGROUP_DEF,;t t
 s,@COND_AP13_TRUE@,$COND_AP13_TRUE,;t t
 s,@COND_AP13_FALSE@,$COND_AP13_FALSE,;t t
diff -u suphp-0.6.1/Makefile.in suphp-0.6.1/Makefile.in
--- suphp-0.6.1/Makefile.in
+++ suphp-0.6.1/Makefile.in
@@ -61,6 +61,7 @@
 host_triplet = @host@
 APACHE_VERSION_1_3 = @APACHE_VERSION_1_3@
 APACHE_VERSION_2 = @APACHE_VERSION_2@
+APR_EXTRA_CFLAGS = @APR_EXTRA_CFLAGS@
 APR_INCLUDEDIR = @APR_INCLUDEDIR@
 APXS = @APXS@
 APXS_EXTRA_CFLAGS = @APXS_EXTRA_CFLAGS@
diff -u suphp-0.6.1/debian/changelog suphp-0.6.1/debian/changelog
--- suphp-0.6.1/debian/changelog
+++ suphp-0.6.1/debian/changelog
@@ -1,3 +1,16 @@
+suphp (0.6.1-1.1) unstable; urgency=low
+
+  * Non-maintainer upload to fix build-dependencies.
+  * Changed apache2-common for apache2.2-common and libapr0-dev for
+    libapr1-dev. (Closes: #391765, #393627)
+  * Modified configure.ac and configure so that it detects that apache 2.2 is
+    still apache2.
+  * Modified configure.ac and configure so that it takes the output of
+    apr-1-config to set the correct compiling parameters.
+  * Modified src/apache2/mod_suphp.c to comply with the changes in libapr1.
+
+ -- Margarita Manterola <[EMAIL PROTECTED]>  Wed, 18 Oct 2006 11:52:10 -0300
+
 suphp (0.6.1-1) unstable; urgency=low
 
   * New upstream release 
diff -u suphp-0.6.1/debian/control suphp-0.6.1/debian/control
--- suphp-0.6.1/debian/control
+++ suphp-0.6.1/debian/control
@@ -2,7 +2,7 @@
 Section: web
 Priority: optional
 Maintainer: Emmanuel Lacour <[EMAIL PROTECTED]>
-Build-Depends: debhelper (>> 4.1.16), apache-dev (>= 1.3.20), 
apache2-prefork-dev (>= 2.0.0), apache2-mpm-prefork (>= 2.0.0), libapr0-dev (>= 
2.0.0), docbook-to-man
+Build-Depends: debhelper (>> 4.1.16), apache-dev (>= 1.3.20), 
apache2-prefork-dev (>= 2.0.0), apache2-mpm-prefork (>= 2.0.0), libapr1-dev, 
docbook-to-man
 Standards-Version: 3.6.2
 
 Package: suphp-common
@@ -24,7 +24,7 @@
 
 Package: libapache2-mod-suphp
 Architecture: any
-Depends: ${shlibs:Depends}, suphp-common (= ${Source-Version}), apache2-common 
(>= 2.0.0), ${misc:Depends}
+Depends: ${shlibs:Depends}, suphp-common (= ${Source-Version}), 
apache2.2-common (>= 2.2.0), ${misc:Depends}
 Description: Apache2 module to run php scripts with the owner permissions
  With the use of the suphp setuid root binary (from suphp-common package),
  this Apache2 module change the uid of the process executing the PHP
diff -u suphp-0.6.1/debian/rules suphp-0.6.1/debian/rules
--- suphp-0.6.1/debian/rules
+++ suphp-0.6.1/debian/rules
@@ -37,6 +37,7 @@
        ./configure --prefix=/usr \
        --sysconfdir=/etc/suphp \
        --with-apxs=/usr/bin/apxs2 \
+       --with-apr=/usr/bin/apr-1-config \
        --with-apache-user=www-data \
        --with-php=/usr/bin/php-cgi \
        --sbindir=/usr/lib/suphp \
only in patch2:
unchanged:
--- suphp-0.6.1.orig/src/apache2/Makefile.am
+++ suphp-0.6.1/src/apache2/Makefile.am
@@ -2,7 +2,7 @@
   DEFINE_USERGROUP = -DSUPHP_USE_USERGROUP
 endif
 
[EMAIL PROTECTED]@ [EMAIL PROTECTED]@ @APXS_EXTRA_CFLAGS@
[EMAIL PROTECTED]@ [EMAIL PROTECTED]@ @APXS_EXTRA_CFLAGS@ @APR_EXTRA_CFLAGS@
 AM_CFLAGS+=-DSUPHP_PATH_TO_SUPHP=\"${sbindir}/suphp\" $(DEFINE_USERGROUP)
 
 noinst_LTLIBRARIES = mod_suphp.la
only in patch2:
unchanged:
--- suphp-0.6.1.orig/configure.ac
+++ suphp-0.6.1/configure.ac
@@ -66,7 +66,7 @@
                     | cut -f2 -d"/" \
                     | cut -f1 -d" "`
     major_version=`echo $APACHE_VERSION|cut -f1,2 -d.`
-    if test "$major_version" = "2.0"; then
+    if test "$major_version" = "2.0" || test "$major_version" = "2.2"; then
       APACHE_VERSION_2=true
       APACHE_VERSION_1_3=false
     else
@@ -100,7 +100,9 @@
 dnl For Apache 2.x APR is needed
     if test x"${apr_found}" = xyes ; then \
         APR_INCLUDEDIR=`${apr_config} --includedir`
+               APR_EXTRA_CFLAGS=`${apr_config} --cppflags`
        AC_SUBST([APR_INCLUDEDIR])
+       AC_SUBST([APR_EXTRA_CFLAGS])
     else
        AC_MSG_ERROR([APR is needed to build mod_suphp for Apache 2.x but was 
not found])
     fi

Reply via email to