rpms/mod_suphp/devel mod_suphp-0.6.1-apr.patch, NONE, 1.1 mod_suphp.spec, 1.9, 1.10

Andreas Thienemann (ixs) fedora-extras-commits at redhat.com
Mon Feb 6 23:44:46 UTC 2006


Author: ixs

Update of /cvs/extras/rpms/mod_suphp/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7326

Modified Files:
	mod_suphp.spec 
Added Files:
	mod_suphp-0.6.1-apr.patch 
Log Message:
Fixes for newer apr in FC5


mod_suphp-0.6.1-apr.patch:

--- NEW FILE mod_suphp-0.6.1-apr.patch ---
>From peter.wullinger at gmail.com  Sat Jan  7 19:29:36 2006
From: peter.wullinger at gmail.com (Peter Wullinger)
Date: Sat Jan  7 19:29:43 2006
Subject: [suPHP] Patches for apr 1.0 (apache 2.2.0)
Message-ID: <20060107182936.GA1807 at kaliope.csn.tu-chemnitz.de>


Good evening,

APR_BRIGAGE_FOREACH() was deprecated in the apr bucket API,
so suphp breaks, when using apache >= 2.2.0 and the new
apr API.  APR_STATUS_IS_SUCCESS() is also gone.

The following patch remedies this problem by completely
removing all uses of the macros in question alltogether.

I have tested these with apache 2.2.0 and apr 1.2.2.

NOTE:
	These patches also add the often ACCESS_CONF support
	for suPHP_AddHandler and suPHP_RemoveHandler.
	Remove these lines from the patch, if you don't want them.

Cheers,
	Peter

--
--- src/apache2/mod_suphp.c.orig	Sat Jan  7 19:03:59 2006
+++ src/apache2/mod_suphp.c	Sat Jan  7 19:20:32 2006
@@ -56,7 +56,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,7 +558,9 @@
             return rv;
         }
         
-        APR_BRIGADE_FOREACH(bucket, bb)
+		
+		bucket = APR_BRIGADE_FIRST(bb);
+		while (bucket != APR_BRIGADE_SENTINEL(bb))
         {
             const char *data;
             apr_size_t len;
@@ -582,6 +584,8 @@
             {
                 child_stopped_reading = 1;
             }
+			
+			bucket = APR_BUCKET_NEXT(bucket);
         }
         apr_brigade_cleanup(bb);
     }
@@ -634,12 +638,15 @@
             
             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 +662,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;
--

-- 
Gl?cklich ist nicht, wer anderen so vorkommt,
sondern wer sich selbst daf?r h?lt.
	-- Lucius Annaeus Seneca


Index: mod_suphp.spec
===================================================================
RCS file: /cvs/extras/rpms/mod_suphp/devel/mod_suphp.spec,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- mod_suphp.spec	6 Feb 2006 17:06:50 -0000	1.9
+++ mod_suphp.spec	6 Feb 2006 23:44:45 -0000	1.10
@@ -1,15 +1,22 @@
 # Depending on what version of Fedora we're on, use a different php binary
 %if 0%{?fedora}
-	%if "%fedora" >= "4"
-	   %define php /usr/bin/php-cgi
-	%else
-	   %define php /usr/bin/php
-	%endif
+   %if "%{fedora}" >= "5"
+      %define php /usr/bin/php-cgi
+      %define apr /usr/bin/apr-1-config
+   %endif
+   %if "%{fedora}" == "4"
+      %define php /usr/bin/php-cgi
+      %define apr /usr/bin/apr-config
+   %endif
+   %if "%{fedora}" <= "3"
+      %define php /usr/bin/php
+      %define apr /usr/bin/apr-config
+   %endif
 %else
    %define php /usr/bin/php
+   %define apr /usr/bin/apr-config
 %endif
 
-
 Summary: An apache2 module for executing PHP scripts with the permissions of their owners
 Name: mod_suphp
 Version: 0.6.1
@@ -22,6 +29,7 @@
 Source3: README.fedora
 Patch0: mod_suphp-0.6.1-userdir.patch
 Patch1: mod_suphp-0.6.1-AddHandler.patch
+Patch2: mod_suphp-0.6.1-apr.patch
 URL: http://www.suphp.org/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Requires: httpd >= 2.0, php
@@ -39,9 +47,16 @@
 %patch0 -p 1 -b .userdir
 %patch1 -p 1 -b .AddHandler
 
+# Patch source to conform to apr 1.x standards
+%if "%{fedora}" >= "5"
+%patch2 -p 0 -b .apr
+%endif
+
 %build
-echo "Building mod_suphp with %{php} as PHP interpreter"
+echo "Building mod_suphp with %{php} as PHP interpreter and %{apr} for the apr configuration script."
 %configure \
+	--with-apr=%{apr} \
+	--with-apxs=/usr/sbin/apxs \
 	--with-apache-user=apache \
 	--with-min-uid=500 \
 	--with-min-gid=500 \




More information about the scm-commits mailing list