Hi there
I made a patch for suphp-0.6.1, so it can be used with apache 2.2. suphp
isn't in blfs and nowhere listed as a dependency, though, but it's a
useful program to run php scripts with the permissions of their owners.
Simon
--
simon scheiwiller
bollstrasse 21
ch-8405 winterthur
+41 78 624 16 73
Submitted By: Simon Scheiwiller <simon at hornweb dot ch>
Date: 2006-05-23
Initial Package Version: 0.6.1
Upstream Status: Not submitted - Needs more testing
Origin: Simon Scheiwiller
Description: Makes suphp usable with apache 2.2
diff -Naur suphp-0.6.1-old/Makefile.in suphp-0.6.1-new/Makefile.in
--- suphp-0.6.1-old/Makefile.in 2005-11-26 19:45:49.000000000 +0000
+++ suphp-0.6.1-new/Makefile.in 2006-05-24 00:51:48.000000000 +0000
@@ -91,7 +91,7 @@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
+CFLAGS = -D_LARGEFILE64_SOURCE @CFLAGS@
COND_AP13_FALSE = @COND_AP13_FALSE@
COND_AP13_TRUE = @COND_AP13_TRUE@
COND_AP20_FALSE = @COND_AP20_FALSE@
diff -Naur suphp-0.6.1-old/configure suphp-0.6.1-new/configure
--- suphp-0.6.1-old/configure 2005-11-26 19:45:49.000000000 +0000
+++ suphp-0.6.1-new/configure 2006-05-24 00:51:24.000000000 +0000
@@ -20339,9 +20339,15 @@
if $TEST_X "$withval/bin/apr-config"; then
apr_found="yes"
apr_config="$withval/bin/apr-config"
+ elif $TEST_X "$withval/bin/apr-1-config"; then
+ apr_found="yes"
+ apr_config="$withval/bin/apr-1-config"
elif $TEST_X "$withval/apr-config"; then
apr_found="yes"
apr_config="$withval/apr-config"
+ elif $TEST_X "$withval/apr-1-config"; then
+ apr_found="yes"
+ apr_config="$withval/apr-1-config"
elif $TEST_X "$withval" && $withval --help > /dev/null 2>&1 ; then
apr_found="yes"
apr_config="$withval"
@@ -20370,12 +20376,19 @@
if apr-config --help > /dev/null 2>&1 ; then
apr_found="yes"
apr_config="apr-config"
+ elif apr-1-config --help > /dev/null 2>&1 ; then
+ apr_found="yes"
+ apr_config="apr-1-config"
else
for lookdir in /usr /usr/local /opt/apr /usr/local/apache2 ; do
if $TEST_X "$lookdir/bin/apr-config"; then
apr_found="yes"
apr_config="$lookdir/bin/apr-config"
break
+ elif $TEST_X "$lookdir/bin/apr-1-config"; then
+ apr_found="yes"
+ apr_config="$lookdir/bin/apr-1-config";
+ break
fi
done
fi
@@ -20425,7 +20438,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
diff -Naur suphp-0.6.1-old/src/Makefile.in suphp-0.6.1-new/src/Makefile.in
--- suphp-0.6.1-old/src/Makefile.in 2005-11-26 19:45:49.000000000 +0000
+++ suphp-0.6.1-new/src/Makefile.in 2006-05-24 00:52:07.000000000 +0000
@@ -112,7 +112,7 @@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
+CFLAGS = -D_LARGEFILE64_SOURCE @CFLAGS@
COND_AP13_FALSE = @COND_AP13_FALSE@
COND_AP13_TRUE = @COND_AP13_TRUE@
COND_AP20_FALSE = @COND_AP20_FALSE@
diff -Naur suphp-0.6.1-old/src/apache2/Makefile.in suphp-0.6.1-new/src/apache2/Makefile.in
--- suphp-0.6.1-old/src/apache2/Makefile.in 2005-11-26 19:45:49.000000000 +0000
+++ suphp-0.6.1-new/src/apache2/Makefile.in 2006-05-24 00:52:22.000000000 +0000
@@ -84,7 +84,7 @@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
+CFLAGS = -D_LARGEFILE64_SOURCE @CFLAGS@
COND_AP13_FALSE = @COND_AP13_FALSE@
COND_AP13_TRUE = @COND_AP13_TRUE@
COND_AP20_FALSE = @COND_AP20_FALSE@
diff -Naur suphp-0.6.1-old/src/apache2/mod_suphp.c suphp-0.6.1-new/src/apache2/mod_suphp.c
--- suphp-0.6.1-old/src/apache2/mod_suphp.c 2005-11-26 19:45:49.000000000 +0000
+++ suphp-0.6.1-new/src/apache2/mod_suphp.c 2006-05-24 00:50:08.000000000 +0000
@@ -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;
}
@@ -313,8 +313,8 @@
AP_INIT_TAKE2("suPHP_UserGroup", suphp_handle_cmd_user_group, NULL, RSRC_CONF | ACCESS_CONF,
"User and group scripts shall be run as"),
#endif
- AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, ACCESS_CONF, "Tells mod_suphp to handle these MIME-types"),
- AP_INIT_ITERATE("suPHP_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, ACCESS_CONF, "Tells mod_suphp not to handle these MIME-types"),
+ AP_INIT_ITERATE("suPHP_AddHandler", suphp_handle_cmd_add_handler, NULL, RSRC_CONF | ACCESS_CONF, "Tells mod_suphp to handle these MIME-types"),
+ AP_INIT_ITERATE("suPHP_RemoveHandler", suphp_handle_cmd_remove_handler, NULL, RSRC_CONF | ACCESS_CONF, "Tells mod_suphp not to handle these MIME-types"),
{NULL}
};
@@ -558,8 +558,8 @@
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;
int child_stopped_reading = 0;
@@ -582,7 +582,8 @@
{
child_stopped_reading = 1;
}
- }
+ bucket = APR_BUCKET_NEXT(bucket);
+ }
apr_brigade_cleanup(bb);
}
while (!eos_reached);
@@ -634,13 +635,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);
r->method = apr_pstrdup(r->pool, "GET");
@@ -655,13 +657,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;
}
--
http://linuxfromscratch.org/mailman/listinfo/patches
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page