components/apache2-modules/mod_perl/patches/TestConfigParse.patch
changeset 4788 159f02dfcdd3
parent 3563 a34ad418afb9
equal deleted inserted replaced
4787:9df2862df01c 4788:159f02dfcdd3
     1 Patch origin: in-house
     1 Patch origin: in-house
     2 Patch status: Solaris-specific; not suitable for upstream
     2 Patch status: Solaris-specific; not suitable for upstream
     3 
     3 
     4 This change makes sure that 64 bit modules and mod_fcgid module are not
     4 For Apache 2.2 distinguishes 32bit and 64bit modules.
     5 used for testing. Mod_fcgid is disabled because it by default creates
     5 For Apache 2.4 removes all MPMs modules except event MPM.
     6 shared memory and socket in paths which are not suitable for ordinary
       
     7 user (or there can be interaction with running Apache).
       
     8 
     6 
     9 --- mod_perl-2.0.4/Apache-Test/lib/Apache/TestConfigParse.pm
     7 --- Apache-Test/lib/Apache/TestConfigParse.pm
    10 +++ mod_perl-2.0.4/Apache-Test/lib/Apache/TestConfigParse.pm
     8 +++ Apache-Test/lib/Apache/TestConfigParse.pm
    11 @@ -211,6 +211,16 @@
     9 @@ -20,6 +20,7 @@
       
    10  
       
    11  use strict;
       
    12  use warnings FATAL => 'all';
       
    13 +use Cwd;
       
    14  
       
    15  use Apache::TestTrace;
       
    16  
       
    17 @@ -185,7 +186,7 @@
       
    18  # - mod_fcgid causes https://rt.cpan.org/Public/Bug/Display.html?id=54476
       
    19  # - mod_modnss.c and mod_rev.c require further configuration
       
    20  my @autoconfig_skip_module = qw(mod_jk.c mod_casp2.c mod_bwshare.c
       
    21 -    mod_fcgid.c mod_evasive20.c mod_modnss.c mod_rev.c);
       
    22 +    mod_fcgid.c mod_evasive20.c mod_modnss.c mod_rev.c mod_mpm_prefork.c mod_mpm_worker.c);
       
    23  
       
    24  # add modules to be not inherited from the existing config.
       
    25  # e.g. prevent from LoadModule perl_module to be included twice, when
       
    26 @@ -212,10 +213,26 @@
       
    27  #inherit LoadModule
       
    28  sub inherit_load_module {
       
    29      my($self, $c, $directive) = @_;
       
    30 +    my $httpd64bit = 0;
       
    31 +    my $cwd = getcwd();
       
    32 +    if (index($cwd, "amd64") != -1 or index($cwd, "sparcv9") != -1) {
       
    33 +        $httpd64bit = 1;
       
    34 +    }
       
    35  
    12      for my $args (@{ $c->{$directive} }) {
    36      for my $args (@{ $c->{$directive} }) {
    13          my $modname = $args->[0];
    37          my $modname = $args->[0];
    14          my $file = $self->server_file_rel2abs($args->[1]);
    38          my $file = $self->server_file_rel2abs($args->[1]);
    15 +	
    39 +        if ($httpd64bit == 0) {
    16 +        unless ($file !~ m/\/64\//) {
    40 +            unless ($file !~ m/\/64\//) {
    17 +            debug "$file is 64 bit module (we don't want it)";
    41 +                debug "$file is 64 bit module (we don't want it)";
    18 +            next;
    42 +                next;
    19 +        }
    43 +            }
    20 +
    44 +        } else {
    21 +        unless ($file !~ m/mod_fcgid.so/) {
    45 +            unless ($file =~ m/\/64\// || $file =~ m/\/2\.4\//) {
    22 +            debug "$file creates shared memory and sockets on wrong place (skipping)";
    46 +                debug "$file is 32 bit module (we don't want it)";
    23 +            next;
    47 +                next;
       
    48 +            }
    24 +        }
    49 +        }
    25  
    50  
    26          unless (-e $file) {
    51          unless (-e $file) {
    27              debug "$file does not exist, skipping LoadModule";
    52              debug "$file does not exist, skipping LoadModule";