Author: jkaluza
Date: Mon Jun 24 12:26:43 2013
New Revision: 1496004

URL: http://svn.apache.org/r1496004
Log:
Merged revisions 
1451907,1455340,1456372,1457512,1457617-1457619,1458176,1460976,1469131,1469135,1469140,1470641,1477980,1477995,1491887
 via svnmerge from 
https://svn.apache.org/repos/asf/perl/modperl/trunk

........
  r1451907 | torsten | 2013-03-02 18:20:05 +0100 (Sat, 02 Mar 2013) | 1 line
  
  use APR::Finfo instead of Perls stat() in ModPerl::RegistryCooker
........
  r1455340 | stevehay | 2013-03-11 22:38:15 +0100 (Mon, 11 Mar 2013) | 2 lines
  
  Fix t/perl/hash_attack.t to work with Perl 5.14.4, 5.16.3 etc, which contain 
a fix for CVE-2013-1667 (memory exhaustion with arbitrary hash keys). This 
resolves rt.perl.org #116863, from where the patch by Hugo van der Sanden was 
taken (with a minor edit in a comment by the committer).
  Tested by the committer on Windows 7 x64 with VC++ 2010 using Perls 5.14.3, 
5.14.4, 5.16.2 and 5.16.3-RC1, all against Apache 2.2.22.
........
  r1456372 | stevehay | 2013-03-14 10:25:34 +0100 (Thu, 14 Mar 2013) | 5 lines
  
  On Perl 5.17.9, t/apache/read2.t fails because an "uninitialized value"
  warning is generated for the buffer being autovivified. This is because
  the sv_setpvn() that's meant to vivify the buffer doesn't perform set
  magic; the warning is generated by the immediately following SvPV_force().
  Patch to fix this from rt.cpan.org #83922. [Zefram]
........
  r1457512 | stevehay | 2013-03-17 19:48:50 +0100 (Sun, 17 Mar 2013) | 3 lines
  
  Restore build with Perl 5.8.x (although 5.8.0 still has other problems for 
me).
  - Recent perls set $Config{usethreads} to 'define' when built with ithreads, 
but older perls did not (-Dusethreads was different to -Duseithreads), causing 
a perl version check failure when wrongly testing $Config{usethreads} instead 
of the intended $Config{useithreads}.
  - Newx and Newxz were added in 5.9.3.
........
  r1457617 | stevehay | 2013-03-18 02:57:39 +0100 (Mon, 18 Mar 2013) | 1 line
  
  Add Changes entry for revision 1457512.
........
  r1457618 | stevehay | 2013-03-18 02:59:22 +0100 (Mon, 18 Mar 2013) | 2 lines
  
  On Perl 5.17.6 and above, hash seeding has changed, and HvREHASH has 
disappeared.
  Patch to update mod_perl accordingly from rt.cpan.org #83921. [Zefram]
........
  r1457619 | stevehay | 2013-03-18 03:07:50 +0100 (Mon, 18 Mar 2013) | 2 lines
  
  Perl 5.16.3's fix for a rehash-based DoS makes it more difficult to invoke 
the workaround for the old hash collision attack, which breaks mod_perl's 
t/perl/hash_attack.t. Patch from rt.cpan.org #83916 improves the fix previously 
applied as revision 1455340. [Zefram]
  Tested by the committer on Windows 7 x64 using Perls 5.8.1, 5.8.2 (VC++ 6.0), 
5.10.1, 5.12.5 (VC++ 2008), 5.14.2, 5.16.3, 5.17.5, 5.17.6 and 5.17.9 (VC++ 
2010), all against Apache 2.2.22.
........
  r1458176 | stevehay | 2013-03-19 09:30:53 +0100 (Tue, 19 Mar 2013) | 1 line
  
  Clarify the supported Perl versions in the README as agreed on 
d...@perl.apache.org.
........
  r1460976 | phred | 2013-03-26 06:09:39 +0100 (Tue, 26 Mar 2013) | 2 lines
  
  Adjustment to 'make tag' target from last release.
........
  r1469131 | phred | 2013-04-18 03:55:56 +0200 (Thu, 18 Apr 2013) | 1 line
  
  Releasing 2.0.8
........
  r1469135 | phred | 2013-04-18 03:59:45 +0200 (Thu, 18 Apr 2013) | 1 line
  
  Releasing 2.0.8
........
  r1469140 | phred | 2013-04-18 04:21:34 +0200 (Thu, 18 Apr 2013) | 1 line
  
  start 2.0.8-dev cycle
........
  r1470641 | phred | 2013-04-22 20:09:23 +0200 (Mon, 22 Apr 2013) | 2 lines
  
  Notes from 2.0.8 release
........
  r1477980 | stevehay | 2013-05-01 15:15:06 +0200 (Wed, 01 May 2013) | 5 lines
  
  Don't write an 'rpm' target into the Makefile on Windows. It isn't relevant 
on Windows, and the (hard-coded, not MakeMaker-generated) recipe group has 
syntax which dmake doesn't understand.
  
  Using MinGW/+dmake to build mod_perl on Windows seems doomed to failure since 
that would require a MinGW build of Apache too, which is not well supported at 
best. However, this change means that any attempt to do so at least gets you 
down to the real problem (it starts compiling the first source file and falls 
over because a header file is missing), rather than choking on an invalid 
Makefile.
  
  It also allows for building with VC+dmake (rather than its native nmake), 
which is an option supported by Perl and inherited by mod_perl via MakeMaker.
........
  r1477995 | stevehay | 2013-05-01 15:33:36 +0200 (Wed, 01 May 2013) | 1 line
  
  Fix the build with VC++ and dmake (rather than nmake) on Windows. The 
Makefile generated by Apache2::Build uses shell commands for the manifest file, 
but neglected to tell dmake to use the shell.
........
  r1491887 | gozer | 2013-06-11 19:50:57 +0200 (Tue, 11 Jun 2013) | 6 lines
  
  Re-enable test for local %ENV, now fixed.
  
  Fixed-By-Revision: 357236
  Reviewed-By: Gozer
........

Added:
    perl/modperl/branches/httpd24/ModPerl-Registry/t/404-filename-with-newline.t
      - copied unchanged from r1491887, 
perl/modperl/trunk/ModPerl-Registry/t/404-filename-with-newline.t
Modified:
    perl/modperl/branches/httpd24/   (props changed)
    perl/modperl/branches/httpd24/Changes
    perl/modperl/branches/httpd24/META.yml
    perl/modperl/branches/httpd24/Makefile.PL
    perl/modperl/branches/httpd24/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
    perl/modperl/branches/httpd24/ModPerl-Registry/lib/ModPerl/RegistryLoader.pm
    perl/modperl/branches/httpd24/ModPerl-Registry/t/cgi-bin/closure.pl
    perl/modperl/branches/httpd24/README
    perl/modperl/branches/httpd24/RELEASE
    perl/modperl/branches/httpd24/STATUS
    perl/modperl/branches/httpd24/lib/Apache2/Build.pm
    perl/modperl/branches/httpd24/lib/mod_perl2.pm
    perl/modperl/branches/httpd24/src/modules/perl/modperl_perl.c
    perl/modperl/branches/httpd24/src/modules/perl/modperl_perl.h
    perl/modperl/branches/httpd24/t/modperl/local_env.t
    perl/modperl/branches/httpd24/t/perl/hash_attack.t
    perl/modperl/branches/httpd24/t/response/TestPerl/hash_attack.pm
    perl/modperl/branches/httpd24/xs/Apache2/RequestIO/Apache2__RequestIO.h

Propchange: perl/modperl/branches/httpd24/
------------------------------------------------------------------------------
  Merged /perl/modperl/trunk:r1451907-1491887

Propchange: perl/modperl/branches/httpd24/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jun 24 12:26:43 2013
@@ -1 +1 @@
-/perl/modperl/branches/threading:1-584361 /perl/modperl/trunk:1-1447142
+/perl/modperl/branches/threading:1-584361 /perl/modperl/trunk:1-1496003

Modified: perl/modperl/branches/httpd24/Changes
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/Changes?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/Changes (original)
+++ perl/modperl/branches/httpd24/Changes Mon Jun 24 12:26:43 2013
@@ -10,7 +10,45 @@ Also refer to the Apache::Test changes l
 
 =over 3
 
-=item 2.0.8-dev
+=item 2.0.9-dev
+
+Fix the build with VC++ and dmake (rather than nmake) on Windows. The
+Makefile generated by Apache2::Build uses shell commands for the manifest
+file, but neglected to tell dmake to use the shell. [Steve Hay]
+
+Don't write an 'rpm' target into the Makefile on Windows. It isn't relevant
+on Windows, and the (hard-coded, not MakeMaker-generated) recipe group has
+syntax which dmake doesn't understand. [Steve Hay]
+
+=item 2.0.8 April 17, 2013
+
+Perl 5.16.3's fix for a rehash-based DoS makes it more difficult to invoke
+the workaround for the old hash collision attack, which breaks mod_perl's
+t/perl/hash_attack.t. Patch from rt.cpan.org #83916 improves the fix
+previously applied as revision 1455340. [Zefram]
+
+On Perl 5.17.6 and above, hash seeding has changed, and HvREHASH has
+disappeared. Patch to update mod_perl accordingly from rt.cpan.org #83921.
+[Zefram]
+
+Restore build with Perl 5.8.1, 5.8.2 etc: take care to use
+$Config{useithreads} rather than $Config{usethreads}, and supply definitions
+of Newx and Newxz as necessary. [Steve Hay]
+
+On Perl 5.17.9, t/apache/read2.t fails because an "uninitialized value"
+warning is generated for the buffer being autovivified. This is because
+the sv_setpvn() that's meant to vivify the buffer doesn't perform set
+magic; the warning is generated by the immediately following SvPV_force().
+Patch to fix this from rt.cpan.org #83922. [Zefram]
+
+Fix t/perl/hash_attack.t to work with Perl 5.14.4, 5.16.3 etc, which
+contain a fix for CVE-2013-1667 (memory exhaustion with arbitrary hash
+keys). This resolves rt.perl.org #116863, from where the patch was taken.
+[Hugo van der Sanden]
+
+use APR::Finfo instead of Perl's stat() in ModPerl::RegistryCooker to
+generate HTTP code 404 even if the requested filename contains newlines
+[Torsten]
 
 Remove all uses of deprecated core perl symbols. [Steve Hay]
 

Modified: perl/modperl/branches/httpd24/META.yml
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/META.yml?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/META.yml (original)
+++ perl/modperl/branches/httpd24/META.yml Mon Jun 24 12:26:43 2013
@@ -1,5 +1,6 @@
 name:         mod_perl
 version_from: lib/mod_perl2.pm
+version: 2.0.8
 installdirs:  site
 distribution_type: module
 no_index:

Modified: perl/modperl/branches/httpd24/Makefile.PL
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/Makefile.PL?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/Makefile.PL (original)
+++ perl/modperl/branches/httpd24/Makefile.PL Mon Jun 24 12:26:43 2013
@@ -511,7 +511,7 @@ sub perl_version_check {
         my @fail;
         push @fail, "Perl 5.8 or higher"
             unless $] >= 5.008;
-        push @fail, "Perl built with ithreads (build perl with -Dusethreads)"
+        push @fail, "Perl built with ithreads (build perl with -Duseithreads)"
             unless Apache2::Build::PERL_HAS_ITHREADS();
         if (@fail) {
             error "$perl_string and '$mpm' mpm httpd.",
@@ -545,7 +545,7 @@ sub perl_version_check {
         exit 1;
     }
 
-    if ($Config{usemultiplicity} xor $Config{usethreads}) {
+    if ($Config{usemultiplicity} xor $Config{useithreads}) {
         error "mod_perl does not currently support multiplicity without ".
              "ithreads.";
         if ($build->mpm_is_threaded()) {
@@ -821,7 +821,14 @@ sub MY::postamble {
 
     my $string = $self->ModPerl::BuildMM::MY::postamble;
 
-    $string .= <<'EOF';
+    if (WIN32) {
+        $string .= <<'EOF';
+mydist : Apache-Test/META.yml manifest tardist
+
+EOF
+    }
+    else {
+        $string .= <<'EOF';
 mydist : Apache-Test/META.yml mod_perl.spec manifest tardist
 
 rpm: dist
@@ -835,10 +842,15 @@ rpm: dist
 mod_perl.spec: build/make_rpm_spec
        $(PERL) build/make_rpm_spec
 
+EOF
+    }
+
+    $string .= <<'EOF';
 Apache-Test/META.yml:
        cd Apache-Test && make metafile
 
 tag :
+       svn copy  https://svn.apache.org/repos/asf/perl/modperl/trunk  
https://svn.apache.org/repos/asf/perl/modperl/branches/release/$(VERSION_SYM)
        svn copy  
https://svn.apache.org/repos/asf/perl/modperl/branches/release/$(VERSION_SYM)  
https://svn.apache.org/repos/asf/perl/modperl/tags/$(VERSION_SYM)
        svn copy  https://svn.apache.org/repos/asf/perl/modperl/docs/trunk 
https://svn.apache.org/repos/asf/perl/modperl/docs/tags/$(VERSION_SYM)
 EOF

Modified: 
perl/modperl/branches/httpd24/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- 
perl/modperl/branches/httpd24/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm 
(original)
+++ 
perl/modperl/branches/httpd24/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm 
Mon Jun 24 12:26:43 2013
@@ -36,6 +36,7 @@ use Apache2::Log ();
 use Apache2::Access ();
 
 use APR::Table ();
+use APR::Finfo ();
 use APR::Status ();
 
 use ModPerl::Util ();
@@ -45,6 +46,7 @@ use File::Spec::Functions ();
 use File::Basename ();
 
 use Apache2::Const -compile => qw(:common &OPT_EXECCGI);
+use APR::Const -compile => qw(FILETYPE_REG);
 use ModPerl::Const -compile => 'EXIT';
 
 unless (defined $ModPerl::Registry::MarkLine) {
@@ -256,9 +258,10 @@ sub can_compile {
     my $self = shift;
     my $r = $self->{REQ};
 
-    return Apache2::Const::DECLINED if -d $r->my_finfo;
+    return Apache2::Const::DECLINED
+        unless $r->finfo->filetype==APR::Const::FILETYPE_REG;
 
-    $self->{MTIME} = -M _;
+    $self->{MTIME} = $r->finfo->mtime;
 
     if (!($r->allow_options & Apache2::Const::OPT_EXECCGI)) {
         $r->log_error("Options ExecCGI is off in this directory",
@@ -485,9 +488,9 @@ sub is_cached {
 # wasn't modified
 sub should_compile_if_modified {
     my $self = shift;
-    $self->{MTIME} ||= -M $self->{REQ}->my_finfo;
+    $self->{MTIME} ||= $self->{REQ}->finfo->mtime;
     !($self->is_cached &&
-      $self->cache_table->{ $self->{PACKAGE} }{mtime} <= $self->{MTIME});
+      $self->cache_table->{ $self->{PACKAGE} }{mtime} == $self->{MTIME});
 }
 
 # return false if the package is cached already
@@ -780,14 +783,5 @@ sub uncache_myself {
 }
 
 
-# XXX: should go away when finfo() is ported to 2.0 (don't want to
-# depend on compat.pm)
-sub Apache2::RequestRec::my_finfo {
-    my $r = shift;
-    stat $r->filename;
-    \*_;
-}
-
-
 1;
 __END__

Modified: 
perl/modperl/branches/httpd24/ModPerl-Registry/lib/ModPerl/RegistryLoader.pm
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/ModPerl-Registry/lib/ModPerl/RegistryLoader.pm?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- 
perl/modperl/branches/httpd24/ModPerl-Registry/lib/ModPerl/RegistryLoader.pm 
(original)
+++ 
perl/modperl/branches/httpd24/ModPerl-Registry/lib/ModPerl/RegistryLoader.pm 
Mon Jun 24 12:26:43 2013
@@ -22,6 +22,8 @@ use ModPerl::RegistryCooker ();
 use Apache2::ServerUtil ();
 use Apache2::Log ();
 use APR::Pool ();
+use APR::Finfo ();
+use APR::Const -compile=>qw(FINFO_NORM);
 
 use Carp;
 use File::Spec ();
@@ -110,8 +112,11 @@ sub handler {
 
 sub get_server_name { return $_[0]->{virthost} if exists $_[0]->{virthost} }
 sub filename { shift->{filename} }
-sub status { Apache2::Const::HTTP_OK }
-sub my_finfo    { shift->{filename} }
+sub status   { Apache2::Const::HTTP_OK }
+sub pool     { shift->{pool}||=APR::Pool->new() }
+sub finfo    { $_[0]->{finfo}||=APR::Finfo::stat($_[0]->{filename},
+                                                 APR::Const::FINFO_NORM,
+                                                 $_[0]->pool); }
 sub uri      { shift->{uri} }
 sub path_info {}
 sub allow_options { Apache2::Const::OPT_EXECCGI } #will be checked again at 
run-time

Modified: perl/modperl/branches/httpd24/ModPerl-Registry/t/cgi-bin/closure.pl
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/ModPerl-Registry/t/cgi-bin/closure.pl?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/ModPerl-Registry/t/cgi-bin/closure.pl 
(original)
+++ perl/modperl/branches/httpd24/ModPerl-Registry/t/cgi-bin/closure.pl Mon Jun 
24 12:26:43 2013
@@ -1,7 +1,7 @@
 #!perl -w
 
 BEGIN {
-    use Apache::TestUtil;
+    use Apache::TestUtil qw/t_server_log_warn_is_expected/;
     t_server_log_warn_is_expected();
 }
 
@@ -16,7 +16,7 @@ my $counter = 0;
 counter();
 
 sub counter {
-    #warn "$$";
+    #warn "$$: counter=$counter";
     print ++$counter;
 }
 

Modified: perl/modperl/branches/httpd24/README
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/README?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/README (original)
+++ perl/modperl/branches/httpd24/README Mon Jun 24 12:26:43 2013
@@ -11,22 +11,16 @@ Apache:
   
http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution
 
 Perl: 
-  Dynamic mod_perl (DSO):
+  Any stable version of Perl currently in support by the Perl community,
+  as described in recent Perl distributions' "perlpolicy.pod" document.
 
-    + prefork mpm:
-      - Perl version 5.6.1 or higher
+  Newer Perl versions may work with this version of mod_perl.  If not,
+  the svn version likely will (see above).
 
-    + non-prefork mpm:
-      - Perl with    ithreads support version 5.8.0 or higher
-
-  Static mod_perl:
-
-    + prefork mpm:
-      - Perl with    ithreads support version 5.6.1 or higher
-      - Perl without ithreads support version 5.8.2 or higher
-
-    + non-prefork mpm:
-      - Perl with    ithreads support version 5.8.0 or higher
+  Many older Perl versions also work with this version of mod_perl:
+  Perls back to version 5.8.2 (and possibly earlier in some build
+  configurations) are currently believed to work, but this is not
+  guaranteed to be the case, either now or in the future.
 
 *** Status ***
 

Modified: perl/modperl/branches/httpd24/RELEASE
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/RELEASE?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/RELEASE (original)
+++ perl/modperl/branches/httpd24/RELEASE Mon Jun 24 12:26:43 2013
@@ -30,13 +30,14 @@ Instructions for mod_perl 2.0 Release Ma
        make sure you give the correct permissions to them.
 
 1. 'make mydist' - to make sure nothing is missing from the manifest,
-   etc. Now test this generated package mod_perl-2.0.8.tar.gz (not
+   etc. Now test this generated package mod_perl-2.0.9.tar.gz (not
    the current build) with as many
    configurations as possible on as many platforms as possible,
    unpacking the package each time afresh.  
 
   a. edit ./Changes 
      - change -dev to -rc\d+  starting with -rc1
+     - edit META.yml to the rc\d version above in the version key
 
   b. nuke any preinstalled mod_perl libs and run 'make test'
 
@@ -55,7 +56,7 @@ Instructions for mod_perl 2.0 Release Ma
    to the modperl/dev list (may be longer to give most people a chance
    to catch up). no need to tag this package
 
-   Subject: [RELEASE CANDIDATE]: mod_perl-2.0.8 RC\d+
+   Subject: [RELEASE CANDIDATE]: mod_perl-2.0.9 RC\d+
 
 2a. if problems are detected during stage 2, repeat stages 1 and 2.
 
@@ -65,6 +66,7 @@ Instructions for mod_perl 2.0 Release Ma
   a. edit ./Changes:
      - remove -rc\d+
      - add release date
+     - edit META.yml to remove the -rc\d+ from the version key
 
   b. check ./README and ./Makefile.PL
      - make sure supported httpd versions (dso & static) are current
@@ -75,7 +77,7 @@ Instructions for mod_perl 2.0 Release Ma
      % make -n tag
 
   d. commit Changes README Makefile.PL
-     % svn ci -m "Releasing 2.0.8" Changes README Makefile.PL
+     % svn ci -m "Releasing 2.0.9" Changes README Makefile.PL
 
   e. tag
      % make tag
@@ -84,54 +86,54 @@ Instructions for mod_perl 2.0 Release Ma
   XXXX: This needs to be fixed, and updated, developer beware its outdated and 
possibly wrong
   f. Update the svn:externals in the new tag
      (you can't propedit remotely yet in svn)
-     % svn co https://svn.apache.org/repos/asf/perl/modperl/tags/2_0_8
-     % svn propedit svn:externals 2_0_8
+     % svn co https://svn.apache.org/repos/asf/perl/modperl/tags/2_0_9
+     % svn propedit svn:externals 2_0_9
      Update the Apache-Test line to current revision
      % svn info https://svn.apache.org/repos/asf/perl/Apache-Test/trunk | grep 
"Last Changed Rev"
      Update the docs line to the current tag.
      It should look like:
-     % svn propget svn:externals 2_0_8
+     % svn propget svn:externals 2_0_9
        Apache-Test -r 608229 
https://svn.apache.org/repos/asf/perl/Apache-Test/trunk
-       docs 
https://svn.apache.org/repos/asf/perl/modperl/docs/tags/2_0_8/src/docs/2.0
+       docs 
https://svn.apache.org/repos/asf/perl/modperl/docs/tags/2_0_9/src/docs/2.0
 
-     % svn ci -m "Releasing 2.0.8"
+     % svn ci -m "Releasing 2.0.9"
 
   g. create the final package
      % make dist
 
   h. test the final package again at least once
 
-4. Release the package and update links (e.g. mod_perl-2.0.8.tar.gz)
+4. Release the package and update links (e.g. mod_perl-2.0.9.tar.gz)
 
   a. upload to people.apache.org:/www/perl.apache.org/dist/ - ask the PMC
      chair to give you the needed permissions if you do not have them.
 
-    %  scp mod_perl-2.0.8.tar.gz people.apache.org:/www/perl.apache.org/dist/
+    %  scp mod_perl-2.0.9.tar.gz people.apache.org:/www/perl.apache.org/dist/
 
   b. ssh to people.apache.org, unpack the package, update symlinks to the
      tar ball and unpacked distro:
 
     % ssh people.apache.org
     % cd /www/perl.apache.org/dist/
-    % ln -sf mod_perl-2.0.8.tar.gz mod_perl-2.0-current.tar.gz
-    % tar -xzvf mod_perl-2.0.8.tar.gz
+    % ln -sf mod_perl-2.0.9.tar.gz mod_perl-2.0-current.tar.gz
+    % tar -xzvf mod_perl-2.0.9.tar.gz
     % rm /www/perl.apache.org/dist/mod_perl-2.0-current
-    % ln -sf  mod_perl-2.0.8 mod_perl-2.0-current
+    % ln -sf  mod_perl-2.0.9 mod_perl-2.0-current
 
   c. archive older releases (keep current + one prior release)
 
-    % mv /www/perl.apache.org/dist/mod_perl-2.0.6.tar.gz \
+    % mv /www/perl.apache.org/dist/mod_perl-2.0.7.tar.gz \
          /www/perl.apache.org/dist/old
-    % mv /www/perl.apache.org/dist/mod_perl-2.0.6.tar.gz.asc \
+    % mv /www/perl.apache.org/dist/mod_perl-2.0.7.tar.gz.asc \
          /www/perl.apache.org/dist/old
-    % rm -rf /www/perl.apache.org/dist/mod_perl-2.0.6
+    % rm -rf /www/perl.apache.org/dist/mod_perl-2.0.7
 
   d. update the version and release date in the docs:
     % vi modperl-docs/src/download/index_top.html 
     % vi modperl-docs/doap_Perl.rdf
 
      and commit.
-    % svn ci -m "Releasing 2.0.8" \
+    % svn ci -m "Releasing 2.0.9" \
           modperl-docs/src/download/index_top.html \
           modperl-docs/doap_Perl.rdf
      
@@ -152,27 +154,27 @@ Instructions for mod_perl 2.0 Release Ma
 
   a. sign your local copy of the tarball:
 
-    % gpg --detach-sign --armor mod_perl-2.0.8.tar.gz
+    % gpg --detach-sign --armor mod_perl-2.0.9.tar.gz
 
-    % pgps -b --armor mod_perl-2.0.8.tar.gz
+    % pgps -b --armor mod_perl-2.0.9.tar.gz
 
   b. upload the generated sig file to people.apache.org:
 
-    % scp mod_perl-2.0.8.tar.gz.asc 
people.apache.org:/www/perl.apache.org/dist/
+    % scp mod_perl-2.0.9.tar.gz.asc 
people.apache.org:/www/perl.apache.org/dist/
     % ssh people.apache.org
     % cd /www/perl.apache.org/dist/
-    % chmod 0664 mod_perl-2.0.8.tar.gz.asc
-    % ln -sf mod_perl-2.0.8.tar.gz.asc mod_perl-2.0-current.tar.gz.asc
+    % chmod 0664 mod_perl-2.0.9.tar.gz.asc
+    % ln -sf mod_perl-2.0.9.tar.gz.asc mod_perl-2.0-current.tar.gz.asc
 
   c. ask one of the other developers to double check the signature file
      and tarball: download both files and verify the signature:
 
-    http://perl.apache.org/dist/mod_perl-2.0.8.tar.gz.asc
-    http://perl.apache.org/dist/mod_perl-2.0.8.tar.gz
+    http://perl.apache.org/dist/mod_perl-2.0.9.tar.gz.asc
+    http://perl.apache.org/dist/mod_perl-2.0.9.tar.gz
 
-    % gpg --verify mod_perl-2.0.8.tar.gz.asc
+    % gpg --verify mod_perl-2.0.9.tar.gz.asc
 
-    % pgpv mod_perl-2.0.8.tar.gz.asc
+    % pgpv mod_perl-2.0.9.tar.gz.asc
 
   d. make sure that the files you just created are group rw so
      all the dist admins can make changes:
@@ -186,10 +188,10 @@ Instructions for mod_perl 2.0 Release Ma
   a. unpack the package, update symlinks to the tarball and unpacked distro:
 
    % cd /www/www.apache.org/dist/perl/
-   % cp /www/perl.apache.org/dist/mod_perl-2.0.8.tar.gz* .
-   % tar -xzvf mod_perl-2.0.8.tar.gz
-   % mv mod_perl-2.0.6.tar.gz* /www/archive.apache.org/dist/perl/
-   % rm -rf mod_perl-2.0.6
+   % cp /www/perl.apache.org/dist/mod_perl-2.0.9.tar.gz* .
+   % tar -xzvf mod_perl-2.0.9.tar.gz
+   % mv mod_perl-2.0.7.tar.gz* /www/archive.apache.org/dist/perl/
+   % rm -rf mod_perl-2.0.7
 
   b. make sure that the files you just created are group rw so
 
@@ -202,11 +204,11 @@ Instructions for mod_perl 2.0 Release Ma
 
   a. post ... to the modperl, announce lists
   Note, to post to announce@, you must be sending from an apache.org address.
-  Subject: [ANNOUNCE] mod_perl 2.0.8 
+  Subject: [ANNOUNCE] mod_perl 2.0.9 
      include 
   - link at perl.apache.org:
-    http://apache.org/dist/perl/mod_perl-2.0.8.tar.gz
-    http://apache.org/dist/perl/mod_perl-2.0.8.tar.gz.asc (pgp sig)
+    http://apache.org/dist/perl/mod_perl-2.0.9.tar.gz
+    http://apache.org/dist/perl/mod_perl-2.0.9.tar.gz.asc (pgp sig)
   - MD5 sig (as it comes from CPAN upload announce).
   - the latest Changes
 
@@ -217,7 +219,7 @@ Instructions for mod_perl 2.0 Release Ma
   b. edit ./Changes:
      - start a new item with incremented version + '-dev'
 
-  =item 2.0.9-dev
+  =item 2.0.10-dev
 
   c. add a release entry in STATUS
 
@@ -228,7 +230,7 @@ Instructions for mod_perl 2.0 Release Ma
 
   e. commit the changed files
 
-     % svn ci -m "start 2.0.8-dev cycle" Changes lib/mod_perl2.pm \
+     % svn ci -m "start 2.0.9-dev cycle" Changes lib/mod_perl2.pm \
        STATUS RELEASE
 
 10. Old Versions

Modified: perl/modperl/branches/httpd24/STATUS
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/STATUS?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/STATUS (original)
+++ perl/modperl/branches/httpd24/STATUS Mon Jun 24 12:26:43 2013
@@ -3,6 +3,7 @@ mod_perl 2.0 STATUS:                    
 
 Release:
 --------
+   2.000.08   : Released Apr 17, 2013
    2.000.07   : Released Jun 05, 2012
    2.000.06   : Released Apr 24, 2012
    2.000.05   : Released Feb 07, 2011

Modified: perl/modperl/branches/httpd24/lib/Apache2/Build.pm
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/lib/Apache2/Build.pm?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/lib/Apache2/Build.pm (original)
+++ perl/modperl/branches/httpd24/lib/Apache2/Build.pm Mon Jun 24 12:26:43 2013
@@ -75,6 +75,7 @@ use constant OPENBSD => $^O eq 'openbsd'
 use constant WIN32   => $^O eq 'MSWin32';
 
 use constant MSVC => WIN32() && ($Config{cc} eq 'cl');
+use constant DMAKE => WIN32() && ($Config{make} eq 'dmake');
 
 use constant REQUIRE_ITHREADS => grep { $^O eq $_ } qw(MSWin32);
 use constant PERL_HAS_ITHREADS =>
@@ -1984,6 +1985,11 @@ EOF
 
     print $fh $install;
 
+    print $fh <<'EOF' if DMAKE;
+
+.USESHELL :
+EOF
+
     print $fh <<'EOF';
 
 .SUFFIXES: .xs .c $(MODPERL_OBJ_EXT) .lo .i .s

Modified: perl/modperl/branches/httpd24/lib/mod_perl2.pm
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/lib/mod_perl2.pm?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/lib/mod_perl2.pm (original)
+++ perl/modperl/branches/httpd24/lib/mod_perl2.pm Mon Jun 24 12:26:43 2013
@@ -19,7 +19,7 @@ use 5.006;
 use strict;
 
 BEGIN {
-    our $VERSION = "2.000008";
+    our $VERSION = "2.000009";
     our $VERSION_TRIPLET;
 
     if ($VERSION =~ /(\d+)\.(\d\d\d)(\d+)/) {

Modified: perl/modperl/branches/httpd24/src/modules/perl/modperl_perl.c
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/src/modules/perl/modperl_perl.c?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/src/modules/perl/modperl_perl.c (original)
+++ perl/modperl/branches/httpd24/src/modules/perl/modperl_perl.c Mon Jun 24 
12:26:43 2013
@@ -265,12 +265,17 @@ void modperl_hash_seed_set(pTHX)
 {
 #ifdef MP_NEED_HASH_SEED_FIXUP
     if (MP_init_hash_seed_set) {
-#if MP_PERL_VERSION(5, 8, 1)
-        PL_hash_seed       = MP_init_hash_seed;
+#if MP_PERL_VERSION_AT_LEAST(5, 17, 6)
+        memcpy(&PL_hash_seed, &MP_init_hash_seed,
+                sizeof(PL_hash_seed) > sizeof(MP_init_hash_seed) ?
+                    sizeof(MP_init_hash_seed) : sizeof(PL_hash_seed));
         PL_hash_seed_set   = MP_init_hash_seed_set;
-#else
+#elif MP_PERL_VERSION_AT_LEAST(5, 8, 2)
         PL_rehash_seed     = MP_init_hash_seed;
         PL_rehash_seed_set = MP_init_hash_seed_set;
+#else
+        PL_hash_seed       = MP_init_hash_seed;
+        PL_hash_seed_set   = MP_init_hash_seed_set;
 #endif
     }
 #endif

Modified: perl/modperl/branches/httpd24/src/modules/perl/modperl_perl.h
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/src/modules/perl/modperl_perl.h?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/src/modules/perl/modperl_perl.h (original)
+++ perl/modperl/branches/httpd24/src/modules/perl/modperl_perl.h Mon Jun 24 
12:26:43 2013
@@ -54,4 +54,11 @@ void modperl_hash_seed_set(pTHX);
 #    define GvGP_set(gv, gp) (GvGP(gv)=(gp))
 #endif
 
+#ifndef Newx
+#    define Newx(v,n,t) New(0,v,n,t)
+#endif
+#ifndef Newxz
+#    define Newxz(v,n,t) Newz(0,v,n,t)
+#endif
+
 #endif /* MODPERL_PERL_H */

Modified: perl/modperl/branches/httpd24/t/modperl/local_env.t
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/t/modperl/local_env.t?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/t/modperl/local_env.t (original)
+++ perl/modperl/branches/httpd24/t/modperl/local_env.t Mon Jun 24 12:26:43 2013
@@ -5,8 +5,6 @@ use Apache::Test;
 use Apache::TestUtil;
 use Apache::TestRequest;
 
-plan tests => 1, skip_reason('local %ENV is still broken');
-
 my $module = 'TestModperl::local_env';
 my $url    = Apache::TestRequest::module2url($module);
 

Modified: perl/modperl/branches/httpd24/t/perl/hash_attack.t
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/t/perl/hash_attack.t?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/t/perl/hash_attack.t (original)
+++ perl/modperl/branches/httpd24/t/perl/hash_attack.t Mon Jun 24 12:26:43 2013
@@ -8,7 +8,7 @@ use Apache::TestTrace;
 use Apache::TestRequest 'GET_BODY_ASSERT';
 
 plan tests => 1,
-    need { "relevant only for perl 5.8.2 and higher" => ($] >= 5.008002) };
+    need { "relevant only for perl 5.8.2 and up to 5.17.6" => ($] >= 5.008002 
&& $] < 5.017006) };
 
 my $expected = "ok";
 my $received = GET_BODY_ASSERT "/TestPerl__hash_attack";

Modified: perl/modperl/branches/httpd24/t/response/TestPerl/hash_attack.pm
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/t/response/TestPerl/hash_attack.pm?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/t/response/TestPerl/hash_attack.pm (original)
+++ perl/modperl/branches/httpd24/t/response/TestPerl/hash_attack.pm Mon Jun 24 
12:26:43 2013
@@ -5,10 +5,11 @@ package TestPerl::hash_attack;
 # and fixup handlers in this test). Moreover it must not fail to find
 # that entry on the subsequent requests.
 #
-# the hash attack is detected when HV_MAX_LENGTH_BEFORE_SPLIT keys
-# find themselves in the same hash bucket, in which case starting from
-# 5.8.2 the hash will rehash all its keys using a random hash seed
-# (PL_new_hash_seed, set in mod_perl or via PERL_HASH_SEED environment
+# the hash attack is detected when HV_MAX_LENGTH_BEFORE_REHASH keys find
+# themselves in the same hash bucket on splitting (which happens when the
+# number of keys crosses the threshold of a power of 2), in which case
+# starting from 5.8.2 the hash will rehash all its keys using a random hash
+# seed (PL_new_hash_seed, set in mod_perl or via PERL_HASH_SEED environment
 # variable)
 #
 # Prior to the attack condition hashes use the PL_hash_seed, which is
@@ -29,7 +30,7 @@ use Math::BigInt;
 
 use constant MASK_U32  => 2**32;
 use constant HASH_SEED => 0; # 5.8.2: always zero before the rehashing
-use constant THRESHOLD => 14; #define HV_MAX_LENGTH_BEFORE_SPLIT
+use constant THRESHOLD => 14; #define HV_MAX_LENGTH_BEFORE_(SPLIT|REHASH)
 use constant START     => "a";
 
 # create conditions which will trigger a rehash on the current stash
@@ -57,6 +58,8 @@ sub handler {
     return Apache2::Const::OK;
 }
 
+sub buckets { scalar(%{$_[0]}) =~ m#/([0-9]+)\z# ? 0+$1 : 8 }
+
 sub attack {
     my $stash = shift;
 
@@ -74,9 +77,9 @@ sub attack {
     my $bits = $keys ? log($keys)/log(2) : 0;
     $bits = $min_bits if $min_bits > $bits;
 
-    $bits = int($bits) < $bits ? int($bits) + 1 : int($bits);
-    # need to add 2 bits to cover the internal split cases
-    $bits += 2;
+    $bits = ceil($bits);
+    # need to add 3 bits to cover the internal split cases
+    $bits += 3;
     my $mask = 2**$bits-1;
     debug "mask: $mask ($bits)";
 
@@ -90,7 +93,7 @@ sub attack {
         next unless ($h & $mask) == 0;
         $c++;
         $stash->{$s}++;
-        debug sprintf "%2d: %5s, %10s, %s", $c, $s, $h, scalar(%$stash);
+        debug sprintf "%2d: %5s, %08x %s", $c, $s, $h, scalar(%$stash);
         push @keys, $s;
         debug "The hash collision attack has been successful"
             if Internals::HvREHASH(%$stash);
@@ -98,6 +101,24 @@ sub attack {
         $s++;
     }
 
+    # If the rehash hasn't been triggered yet, it's being delayed until the
+    # next bucket split.  Add keys until a split occurs.
+    unless (Internals::HvREHASH(%$stash)) {
+        debug "Will add padding keys until hash split";
+        my $old_buckets = buckets($stash);
+        while (buckets($stash) == $old_buckets) {
+            next if exists $stash->{$s};
+            $h = hash($s);
+            $c++;
+            $stash->{$s}++;
+            debug sprintf "%2d: %5s, %08x %s", $c, $s, $h, scalar(%$stash);
+            push @keys, $s;
+            debug "The hash collision attack has been successful"
+                if Internals::HvREHASH(%$stash);
+            $s++;
+        }
+    }
+
     # this verifies that the attack was mounted successfully. If
     # HvREHASH is on it is. Otherwise the sequence wasn't successful.
     die "Failed to mount the hash collision attack"
@@ -108,6 +129,12 @@ sub attack {
     return @keys;
 }
 
+# least integer >= n
+sub ceil {
+    my $value = shift;
+    return int($value) < $value ? int($value) + 1 : int($value);
+}
+
 # trying to provide the fastest equivalent of C macro's PERL_HASH in
 # Perl - the main complication is that the C macro uses U32 integer
 # (unsigned int), which we can't do it Perl (it can do I32, with 'use

Modified: 
perl/modperl/branches/httpd24/xs/Apache2/RequestIO/Apache2__RequestIO.h
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/xs/Apache2/RequestIO/Apache2__RequestIO.h?rev=1496004&r1=1496003&r2=1496004&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/xs/Apache2/RequestIO/Apache2__RequestIO.h 
(original)
+++ perl/modperl/branches/httpd24/xs/Apache2/RequestIO/Apache2__RequestIO.h Mon 
Jun 24 12:26:43 2013
@@ -227,6 +227,10 @@ apr_status_t mpxs_setup_client_block(req
 #define mpxs_should_client_block(r) \
     (r->read_length || ap_should_client_block(r))
 
+#ifndef sv_setpvn_mg
+#   define sv_setpvn_mg sv_setpvn
+#endif
+
 /* alias */
 #define mpxs_Apache2__RequestRec_READ(r, buffer, len, offset) \
     mpxs_Apache2__RequestRec_read(aTHX_ r, buffer, len, offset)
@@ -239,7 +243,7 @@ static SV *mpxs_Apache2__RequestRec_read
     STRLEN blen;
 
     if (!SvOK(buffer)) {
-        sv_setpvn(buffer, "", 0);
+        sv_setpvn_mg(buffer, "", 0);
     }
 
     (void)SvPV_force(buffer, blen); /* make it a valid PV */


Reply via email to