Control: tag -1 patch

On Tue, Jun 06, 2017 at 11:06:05PM +0300, Niko Tyni wrote:
> Package: libapache2-mod-perl2
> Version: 2.0.9~1624218-2+deb8u1
> Severity: serious
> 
> As per
> 
>  
> http://perl.debian.net/rebuild-logs/jessie/libapache2-mod-perl2_2.0.9~1624218-2+deb8u1/libapache2-mod-perl2_2.0.9~1624218-2+deb8u1_amd64-2017-06-05T19:42:17Z.build
> 
> this package currently fails to build in jessie.
> 
>   Test Summary Report
>   -------------------
>   t/apache/read.t                       (Wstat: 0 Tests: 1 Failed: 1)
>     Failed test:  1
>   t/filter/in_bbs_inject_header.t       (Wstat: 512 Tests: 0 Failed: 0)
>     Non-zero exit status: 2
>     Parse errors: Bad plan.  You planned 36 tests but ran 0.
>  
> This is very similar to #849082 and was most probably caused by 
> 
>  apache2 (2.4.10-10+deb8u8) jessie-security; urgency=medium

I've verified that the package builds again with the attached
test suite changes (identical to the ones in stretch/sid.)

I've filed #864770 for pushing this to (almost old-)stable.
-- 
Niko
>From 4a803fdb4c9eae8538293fe31c9222eecb6465be Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Fri, 23 Dec 2016 18:27:23 +0200
Subject: [PATCH 1/2] Fix t/apache/read.t HTTP syntax for Apache 2.4.24
 compatibility

HTTP/1.1 RFC 7230, section 2.6. "Protocol Versioning" says the HTTP name
is case sensitive. Starting with Apache 2.4.24, using lower case will
make the server issue a 400 Bad request response, causing a test failure.

https://tools.ietf.org/html/rfc7230#section-2.6

Bug-Debian: https://bugs.debian.org/849082
---
 t/apache/read.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/apache/read.t b/t/apache/read.t
index 83670c9..9f7f504 100644
--- a/t/apache/read.t
+++ b/t/apache/read.t
@@ -24,7 +24,7 @@ close $fh;
 
 my $size = length $data;
 
-for my $string ("POST $location http/1.0",
+for my $string ("POST $location HTTP/1.0",
                 "Content-length: $size",
                 "") {
     my $line = "$string\r\n";
-- 
2.11.0

>From d59229cf4f5b91ed58e25e27977e76f59096b72d Mon Sep 17 00:00:00 2001
From: Niko Tyni <nt...@debian.org>
Date: Sat, 24 Dec 2016 23:07:28 +0200
Subject: [PATCH 2/2] Fix in_bbs_inject_header line terminators for Apache
 2.4.24 compatibility

rfc7230 3.5 says:

  Although the line terminator for the start-line and header fields is
   the sequence CRLF, a recipient MAY recognize a single LF as a line
   terminator and ignore any preceding CR.

Apache with strict enabled chooses not to implement the MAY.

Author: Stefan Fritsch <s...@sfritsch.de>
Bug-Debian: https://bugs.debian.org/849082
---
 t/filter/TestFilter/in_bbs_inject_header.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/filter/TestFilter/in_bbs_inject_header.pm b/t/filter/TestFilter/in_bbs_inject_header.pm
index b09d6f9..5380c65 100644
--- a/t/filter/TestFilter/in_bbs_inject_header.pm
+++ b/t/filter/TestFilter/in_bbs_inject_header.pm
@@ -181,7 +181,7 @@ sub handler : FilterConnectionHandler {
 
         if ($data and $data =~ /^POST/) {
             # demonstrate how to add a header while processing other headers
-            my $header = "$header1_key: $header1_val\n";
+            my $header = "$header1_key: $header1_val\r\n";
             push @{ $ctx->{buckets} }, APR::Bucket->new($c->bucket_alloc, $header);
             debug "queued header [$header]";
         }
@@ -199,7 +199,7 @@ sub handler : FilterConnectionHandler {
             # we hit the headers and body separator, which is a good
             # time to add extra headers:
             for my $key (keys %headers) {
-                my $header = "$key: $headers{$key}\n";
+                my $header = "$key: $headers{$key}\r\n";
                 push @{ $ctx->{buckets} }, APR::Bucket->new($c->bucket_alloc, $header);
                 debug "queued header [$header]";
             }
-- 
2.11.0

Reply via email to