perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From go...@apache.org
Subject svn commit: r371775 - in /perl/modperl/trunk: Changes lib/ModPerl/Code.pm src/modules/perl/modperl_cmd.c src/modules/perl/modperl_config.c t/conf/extra.last.conf.in
Date Tue, 24 Jan 2006 02:27:14 GMT
Author: gozer
Date: Mon Jan 23 18:27:10 2006
New Revision: 371775

URL: http://svn.apache.org/viewcvs?rev=371775&view=rev
Log:
Resolves a critical bug in 'PerlSwitches +inherit' handling that was
causing segfaults under some usages.

This fix has the nice side-effect of introducing a new & slightly cleaner
syntax to specify inheritance of PerlSwitches: PerlOptions +InheritSwitches

Reported-By: "Eamon Daly" <edaly@nextwavemedia.com>
Report-Thread: http://thread.gmane.org/gmane.comp.apache.mod-perl/22750


Modified:
    perl/modperl/trunk/Changes
    perl/modperl/trunk/lib/ModPerl/Code.pm
    perl/modperl/trunk/src/modules/perl/modperl_cmd.c
    perl/modperl/trunk/src/modules/perl/modperl_config.c
    perl/modperl/trunk/t/conf/extra.last.conf.in

Modified: perl/modperl/trunk/Changes
URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/Changes?rev=371775&r1=371774&r2=371775&view=diff
==============================================================================
--- perl/modperl/trunk/Changes (original)
+++ perl/modperl/trunk/Changes Mon Jan 23 18:27:10 2006
@@ -12,6 +12,10 @@
 
 =item 2.0.3-dev
 
+Fix 'PerlSwitches +inherit' that got broken somewhere along
+the way to 2.0. You can also use 'PerlOptions +InheritSwitches'
+for the same result. [Gozer]
+
 Add perl API corresponding to User and Group directives in httpd.conf: 
 Apache2::ServerUtil->user_id and Apache2::ServerUtil->group_id
 [Stas]

Modified: perl/modperl/trunk/lib/ModPerl/Code.pm
URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/lib/ModPerl/Code.pm?rev=371775&r1=371774&r2=371775&view=diff
==============================================================================
--- perl/modperl/trunk/lib/ModPerl/Code.pm (original)
+++ perl/modperl/trunk/lib/ModPerl/Code.pm Mon Jan 23 18:27:10 2006
@@ -137,7 +137,7 @@
 my @ithread_opts = qw(CLONE PARENT);
 my %flags = (
     Srv => ['NONE', @ithread_opts, qw(ENABLE AUTOLOAD MERGE_HANDLERS),
-            @hook_flags, 'UNSET'],
+            @hook_flags, 'UNSET','INHERIT_SWITCHES'],
     Dir => [qw(NONE PARSE_HEADERS SETUP_ENV MERGE_HANDLERS GLOBAL_REQUEST UNSET)],
     Req => [qw(NONE SET_GLOBAL_REQUEST PARSE_HEADERS SETUP_ENV 
                CLEANUP_REGISTERED PERL_SET_ENV_DIR PERL_SET_ENV_SRV)],

Modified: perl/modperl/trunk/src/modules/perl/modperl_cmd.c
URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/modperl_cmd.c?rev=371775&r1=371774&r2=371775&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_cmd.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_cmd.c Mon Jan 23 18:27:10 2006
@@ -156,7 +156,13 @@
         return modperl_cmd_too_late(parms);
     }
     MP_TRACE_d(MP_FUNC, "arg = %s\n", arg);
-    modperl_config_srv_argv_push(arg);
+
+    if(0 == strncasecmp(arg, "+inherit", 8)) {
+        modperl_cmd_options(parms, mconfig, "+InheritSwitches");
+    }
+    else {
+        modperl_config_srv_argv_push(arg);
+    }
     return NULL;
 }
 

Modified: perl/modperl/trunk/src/modules/perl/modperl_config.c
URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/src/modules/perl/modperl_config.c?rev=371775&r1=371774&r2=371775&view=diff
==============================================================================
--- perl/modperl/trunk/src/modules/perl/modperl_config.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_config.c Mon Jan 23 18:27:10 2006
@@ -302,9 +302,7 @@
     merge_item(perl);
 #endif
 
-    if (add->argv->nelts == 2 &&
-        strEQ(((char **)add->argv->elts)[1], "+inherit"))
-    {
+    if (MpSrvINHERIT_SWITCHES(add)) {
         /* only inherit base PerlSwitches if explicitly told to */
         mrg->argv = base->argv;
     }

Modified: perl/modperl/trunk/t/conf/extra.last.conf.in
URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/conf/extra.last.conf.in?rev=371775&r1=371774&r2=371775&view=diff
==============================================================================
--- perl/modperl/trunk/t/conf/extra.last.conf.in (original)
+++ perl/modperl/trunk/t/conf/extra.last.conf.in Mon Jan 23 18:27:10 2006
@@ -94,3 +94,11 @@
 =cut
 
 PerlSetVar TestDirective__pod_cut_worked yes
+
+#This used to trigger a segfault on startup
+#See http://thread.gmane.org/gmane.comp.apache.mod-perl/22750
+<VirtualHost inherit>
+   PerlSwitches +inherit
+   PerlOptions +Parent
+   Perl 1
+</VirtualHost>



Mime
View raw message