perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject [PATCH?] bad ScriptSock directive in mod_perl test configuration with httpd 2.4
Date Fri, 15 Nov 2013 16:24:38 GMT
(I'm using/looking at the httpd24threading branch.)

In httpd 2.4, ScriptSock relative paths are relative to
DefaultRelRuntimedir (which itself is SERVERROOT/logs), whereas in prior
releases ScriptSock relative paths are relative to SERVERROOT.

So "ScriptSock logs/cgisock" in t/conf/extra.conf.in will fail with 2.4 (no
SERVERROOT/logs/logs directory).

Here's a hacky, cross-subproject patch to try to address that.  I'm sure it
isn't the right fix, but perhaps it is sufficient to describe the problem.

diff -ru mod_perl.orig/Apache-Test/lib/Apache/TestServer.pm
mod_perl/Apache-Test/lib/Apache/TestServer.pm
--- mod_perl.orig/Apache-Test/lib/Apache/TestServer.pm  2010-10-04
08:06:09.000000000 -0700
+++ mod_perl/Apache-Test/lib/Apache/TestServer.pm       2013-11-15
07:59:43.000000000 -0800
@@ -126,7 +126,12 @@

 sub dversion {
     my $self = shift;
-    "-D APACHE$self->{rev}";
+    if ($self->{version} =~ /2\.(4|5)\.\d/) {
+        "-D APACHE$self->{rev} -D APACHE24";
+    }
+    else {
+        "-D APACHE$self->{rev}";
+    }
 }

 sub config_defines {
diff -ru mod_perl.orig/t/conf/extra.conf.in mod_perl/t/conf/extra.conf.in
--- mod_perl.orig/t/conf/extra.conf.in  2013-10-31 01:51:23.000000000 -0700
+++ mod_perl/t/conf/extra.conf.in       2013-11-15 08:07:55.000000000 -0800
@@ -69,7 +69,12 @@
 # keep everything self-contained, to avoid problems with sandboxes
 # which break when things try to run off /tmp
 <IfModule mod_cgid.c>
-    ScriptSock logs/cgisock
+    <IfDefine APACHE24>
+        ScriptSock cgisock
+    </IfDefine>
+    <IfDefine !APACHE24>
+        ScriptSock logs/cgisock
+    </IfDefine>
 </IfModule>
 <IfModule mod_env.c>
     SetEnv TMPDIR @t_logs@

It seems very useful to be able to check more specific versions (APACHE24,
APACHE22, etc.) without relying on mod_version.

--/--

But another side of this is that the generated t/conf/httpd.conf also has
ScriptSock; it is fully-qualified so it doesn't have the issue with the
different interpretation of relative paths.

Is the right fix to simply zap the ScriptSock in t/conf/extra.conf.in, or
are there cases where one generated .conf is used without the other?

Thanks!

-- 
Born in Roswell... married an alien...
http://emptyhammock.com/

Mime
View raw message