1) On Sept 23: the move of 3 tests to vhosts [1]
2) On Sept 26: the change of the Taint mode [2]
both patches are reversed (i.e. these are the patches against the current cvs that make the segfault go away).
[1]
Index: t/hooks/trans.t =================================================================== RCS file: /home/cvs/modperl-2.0/t/hooks/trans.t,v retrieving revision 1.5 diff -u -r1.5 trans.t --- t/hooks/trans.t 23 Sep 2004 01:44:10 -0000 1.5 +++ t/hooks/trans.t 9 Oct 2004 18:23:34 -0000 @@ -8,20 +8,15 @@ use Apache2 (); use Apache::Const ':common';
-my $module = 'TestHooks::trans';
-Apache::TestRequest::module($module);
-my $path = Apache::TestRequest::module2path($module);
-my $config = Apache::Test::config();
-my $hostport = Apache::TestRequest::hostport($config);
-t_debug("connecting to $hostport");
-
plan tests => 3; t_client_log_error_is_expected();
-ok t_cmp GET_RC("http://$hostport/nope"), NOT_FOUND;
+ok GET_RC('/nope') == NOT_FOUND;
+
+my $module = '/TestHooks/trans.pm';-my $body = GET_BODY "http://$hostport/TestHooks/trans.pm"; +my $body = GET_BODY $module;
-ok $body =~ /package $module/; +ok $body =~ /package TestHooks::trans/;
-ok GET_OK "http://$hostport/phooey"; +ok GET_OK '/phooey'; Index: t/hooks/TestHooks/init.pm =================================================================== RCS file: /home/cvs/modperl-2.0/t/hooks/TestHooks/init.pm,v retrieving revision 1.6 diff -u -r1.6 init.pm --- t/hooks/TestHooks/init.pm 23 Sep 2004 01:44:10 -0000 1.6 +++ t/hooks/TestHooks/init.pm 9 Oct 2004 18:23:34 -0000 @@ -54,15 +54,11 @@
1;
__DATA__
-<NoAutoConfig>
- <VirtualHost TestHooks::init>
+PerlInitHandler TestHooks::init::second
+<Base>
PerlModule TestHooks::init
PerlInitHandler TestHooks::init::first
- <Location /TestHooks__init>
- PerlInitHandler TestHooks::init::second
- PerlResponseHandler TestHooks::init
- PerlResponseHandler TestHooks::init::response
- SetHandler modperl
- </Location>
- </VirtualHost>
-</NoAutoConfig>
+</Base>
+PerlResponseHandler TestHooks::init
+PerlResponseHandler TestHooks::init::response
+SetHandler modperl
Index: t/hooks/TestHooks/trans.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/hooks/TestHooks/trans.pm,v
retrieving revision 1.6
diff -u -r1.6 trans.pm
--- t/hooks/TestHooks/trans.pm 23 Sep 2004 01:44:11 -0000 1.6
+++ t/hooks/TestHooks/trans.pm 9 Oct 2004 18:23:34 -0000
@@ -37,12 +37,5 @@1; __DATA__ -<NoAutoConfig> - <VirtualHost TestHooks::trans> - PerlTransHandler TestHooks::trans - <Location /TestHooks__trans> - PerlResponseHandler Apache::TestHandler::ok1 - SetHandler modperl - </Location> - </VirtualHost> -</NoAutoConfig> +PerlResponseHandler Apache::TestHandler::ok1 +SetHandler modperl Index: t/modules/proxy.t =================================================================== RCS file: /home/cvs/modperl-2.0/t/modules/proxy.t,v retrieving revision 1.5 diff -u -r1.5 proxy.t --- t/modules/proxy.t 23 Sep 2004 01:44:11 -0000 1.5 +++ t/modules/proxy.t 9 Oct 2004 18:23:34 -0000 @@ -3,19 +3,14 @@
use Apache::Test; use Apache::TestUtil; -use Apache::TestRequest;
-my $module = 'TestModules::proxy'; +use Apache::TestRequest;
-Apache::TestRequest::module($module);
-my $path = Apache::TestRequest::module2path($module);
-my $config = Apache::Test::config();
-my $hostport = Apache::TestRequest::hostport($config);
-t_debug("connecting to $hostport");
+my $location = "/TestModules__proxy"; plan tests => 1, (need_module('proxy') &&
need_access);my $expected = "ok"; -my $received = GET_BODY_ASSERT "http://$hostport/$path";; +my $received = GET_BODY_ASSERT $location; ok t_cmp($received, $expected, "internally proxified request"); Index: t/response/TestModules/proxy.pm =================================================================== RCS file: /home/cvs/modperl-2.0/t/response/TestModules/proxy.pm,v retrieving revision 1.6 diff -u -r1.6 proxy.pm --- t/response/TestModules/proxy.pm 23 Sep 2004 01:44:11 -0000 1.6 +++ t/response/TestModules/proxy.pm 9 Oct 2004 18:23:34 -0000 @@ -43,7 +43,6 @@ 1; __END__ <NoAutoConfig> - <VirtualHost TestModules::proxy> <IfModule mod_proxy.c> <Proxy http://@servername@:@port@/*> <IfModule @ACCESS_MODULE@> @@ -60,6 +59,5 @@ PerlResponseHandler TestModules::proxy::response </Location> </IfModule> - </VirtualHost> </NoAutoConfig>
Index: t/response/TestUser/rewrite.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestUser/rewrite.pm,v
retrieving revision 1.3
diff -u -r1.3 rewrite.pm
--- t/response/TestUser/rewrite.pm 23 Sep 2004 01:44:11 -0000 1.3
+++ t/response/TestUser/rewrite.pm 9 Oct 2004 18:23:34 -0000
@@ -62,7 +62,6 @@
1;
__END__
<NoAutoConfig>
- <VirtualHost TestUser::rewrite>
PerlModule TestUser::rewrite
PerlTransHandler TestUser::rewrite::trans
PerlMapToStorageHandler TestUser::rewrite::map2storage
@@ -70,6 +69,5 @@
SetHandler modperl
PerlResponseHandler TestUser::rewrite::response
</Location>
- </VirtualHost>
</NoAutoConfig>[2]
Index: src/modules/perl/modperl_callback.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v
retrieving revision 1.80
diff -u -r1.80 modperl_callback.c
--- src/modules/perl/modperl_callback.c 30 Sep 2004 03:30:29 -0000 1.80
+++ src/modules/perl/modperl_callback.c 9 Oct 2004 18:23:34 -0000
@@ -22,23 +22,8 @@
I32 flags = G_EVAL|G_SCALAR;
dSP;
int count, status = OK;
- int tainted_orig = PL_tainted;- /* handler callbacks shouldn't affect each other's taintedness
- * state, so start every callback with a clear record and restore
- * at the end. one of the main problems we are trying to solve is
- * that when modperl_croak called (which calls perl's
- * croak(Nullch) to throw an error object) it leaves the
- * interprter in the tainted state (which supposedly will be fixed
- * in 5.8.6) which later affects other callbacks that call eval,
- * etc, which triggers perl crash with:
- * Insecure dependency in eval while running setgid.
- * Callback called exit.
- */
- TAINT_NOT;
-
if ((status = modperl_handler_resolve(aTHX_ &handler, p, s)) != OK) {
- PL_tainted = tainted_orig;
return status;
}@@ -123,13 +108,28 @@
else {
SV *status_sv = POPs;- if (status_sv == &PL_sv_undef) {
+ if (SvIOK(status_sv)) {
+ /* normal IV return (e.g., Apache::OK) */
+ status = SvIVX(status_sv);
+ }
+ else if (status_sv == &PL_sv_undef) {
/* ModPerl::Util::exit() and Perl_croak internally
* arrange to return PL_sv_undef with G_EVAL|G_SCALAR */
status = OK;
}
- else {
+ else if (SvPOK(status_sv)) {
+ /* PV return that ought to be treated as IV ("0") */
status = SvIVx(status_sv);
+ MP_TRACE_h(MP_FUNC,
+ "coercing handler %s's return value '%s' into %d",
+ handler->name, SvPV_nolen(status_sv), status);
+ }
+ else {
+ /* any other return types are considered as errors */
+ status = HTTP_INTERNAL_SERVER_ERROR;
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
+ "handler %s didn't return a valid return value!",
+ handler->name);
}
}
@@ -148,9 +148,7 @@
apr_table_set(r->notes, "error-notes", SvPV_nolen(ERRSV));
}
}
-
- PL_tainted = tainted_orig;
-
+
return status;
}
-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
