Blame SOURCES/mod_perl-2.0.10-restrict_perl_section_to_server_scope.patch

b3b187
From jani@ulrik.uio.no Wed Oct 05 09:38:47 2011
b3b187
To: 644169@bugs.debian.org
b3b187
Subject: Re: Bug#644169: libapache2-mod-perl2: PerlOptions -Sections not
b3b187
 permitted in server config, but should be
b3b187
From: Jan Ingvoldstad <jani+debian-2011+@ifi.uio.no>
b3b187
Date: Wed, 05 Oct 2011 11:38:37 +0200
b3b187
MIME-Version: 1.0
b3b187
Content-Transfer-Encoding: 8bit
b3b187
Content-Type: text/plain; charset=utf-8
b3b187
b3b187
Here is a patch that ensures that <Perl> (and Pod) sections are only
b3b187
allowed in the server configuration and not per directory, which
b3b187
incidentally matches the specification table here:
b3b187
b3b187
http://perl.apache.org/docs/2.0/user/config/config.html#mod_perl_Directives_Argument_Types_and_Allowed_Location
b3b187
b3b187
The patch has been tested on the same system where I identified the
b3b187
problem.
b3b187
b3b187
The patch solves the issue for me, and leaves only the following
b3b187
issues, as far as I can tell:
b3b187
b3b187
 - Should there be fine-grained control as "PerlOptions -Sections"
b3b187
   implies or not?
b3b187
b3b187
 - The mod_perl documentation (online and in the module) probably
b3b187
   needs to be changed to reflect that PerlOptions -Sections does not
b3b187
   work.
b3b187
b3b187
Description: allow Perl and Pod sections only in server config
b3b187
Author: Jan Ingvoldstad <jani+debian-mod-perl-2011+@ifi.uio.no>
b3b187
Last-Update: 2011-10-05
b3b187
--- a/src/modules/perl/mod_perl.c	2011-02-02 21:23:45.000000000 +0100
b3b187
+++ b/src/modules/perl/mod_perl.c	2011-10-05 11:05:52.977576861 +0200
b3b187
@@ -913,18 +913,18 @@
b3b187
     MP_CMD_DIR_ITERATE2("PerlAddVar", add_var, "PerlAddVar"),
b3b187
     MP_CMD_DIR_TAKE2("PerlSetEnv", set_env, "PerlSetEnv"),
b3b187
     MP_CMD_SRV_TAKE1("PerlPassEnv", pass_env, "PerlPassEnv"),
b3b187
-    MP_CMD_DIR_RAW_ARGS_ON_READ("
b3b187
-    MP_CMD_DIR_RAW_ARGS("Perl", perldo, "Perl Code"),
b3b187
+    MP_CMD_SRV_RAW_ARGS_ON_READ("
b3b187
+    MP_CMD_SRV_RAW_ARGS("Perl", perldo, "Perl Code"),
b3b187
 
b3b187
     MP_CMD_DIR_TAKE1("PerlSetInputFilter", set_input_filter,
b3b187
                      "filter[;filter]"),
b3b187
     MP_CMD_DIR_TAKE1("PerlSetOutputFilter", set_output_filter,
b3b187
                      "filter[;filter]"),
b3b187
 
b3b187
-    MP_CMD_DIR_RAW_ARGS_ON_READ("=pod", pod, "Start of POD"),
b3b187
-    MP_CMD_DIR_RAW_ARGS_ON_READ("=back", pod, "End of =over"),
b3b187
-    MP_CMD_DIR_RAW_ARGS_ON_READ("=cut", pod_cut, "End of POD"),
b3b187
-    MP_CMD_DIR_RAW_ARGS_ON_READ("__END__", END, "Stop reading config"),
b3b187
+    MP_CMD_SRV_RAW_ARGS_ON_READ("=pod", pod, "Start of POD"),
b3b187
+    MP_CMD_SRV_RAW_ARGS_ON_READ("=back", pod, "End of =over"),
b3b187
+    MP_CMD_SRV_RAW_ARGS_ON_READ("=cut", pod_cut, "End of POD"),
b3b187
+    MP_CMD_SRV_RAW_ARGS_ON_READ("__END__", END, "Stop reading config"),
b3b187
 
b3b187
     MP_CMD_SRV_RAW_ARGS("PerlLoadModule", load_module, "A Perl module"),
b3b187
 #ifdef MP_TRACE
b3b187
b3b187
b3b187