Bug#591462: libwww-perl: redo; outside the scope of the module (LWP/Protocol/http.pm)

2010-08-06 Thread gregor herrmann
On Fri, 06 Aug 2010 14:23:05 -0400, Adam D. Barratt wrote:

> On Tue, August 3, 2010 14:27, Ansgar Burchardt wrote:
> > libwww-perl uses Perl's redo statement incorrectly [1].  This breaks
> > programs that cause libwww-perl to send a header larger than
> > 8k bytes (and maybe others).  This was fixed upstream with the patch
> > from [2].
> [...]
> > [1] 
> > [2] 
> 
> Please go ahead.

Thanks, uploaded.

Cheers,
gregor
-- 
 .''`.   http://info.comodo.priv.at/ -- GPG key IDs: 0x8649AA06, 0x00F3CFE4
 : :' :  Debian GNU/Linux user, admin, & developer - http://www.debian.org/
 `. `'   Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe
   `-BOFH excuse #25:  Decreasing electron flux 


signature.asc
Description: Digital signature


Bug#591462: libwww-perl: redo; outside the scope of the module (LWP/Protocol/http.pm)

2010-08-06 Thread Adam D. Barratt
On Tue, August 3, 2010 14:27, Ansgar Burchardt wrote:
> libwww-perl uses Perl's redo statement incorrectly [1].  This breaks
> programs that cause libwww-perl to send a header larger than
> 8k bytes (and maybe others).  This was fixed upstream with the patch
> from [2].
[...]
> [1] 
> [2] 

Please go ahead.

Regards,

Adam




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#591462: libwww-perl: redo; outside the scope of the module (LWP/Protocol/http.pm)

2010-08-03 Thread Ansgar Burchardt
clone 591462 -1
submitter -1 !
reassign  -1 release.debian.org
retitle   -1 pu: libwww-perl/5.813-1+lenny1
tag   -1 =
severity  -1 normal
user  release.debian@packages.debian.org
usertag   -1 + pu
thanks

Hi,

libwww-perl uses Perl's redo statement incorrectly [1].  This breaks
programs that cause libwww-perl to send a header larger than
8k bytes (and maybe others).  This was fixed upstream with the patch
from [2].

I have prepared an update for stable using upstream's patch.  Is the
release team okay with uploading this to stable?

Regards,
Ansgar

[1] 
[2] 
diff -u libwww-perl-5.813/debian/changelog libwww-perl-5.813/debian/changelog
--- libwww-perl-5.813/debian/changelog
+++ libwww-perl-5.813/debian/changelog
@@ -1,3 +1,9 @@
+libwww-perl (5.813-1+lenny1) stable; urgency=low
+
+  * Fix incorrect use of redo. (Closes: #591462)
+
+ -- Ansgar Burchardt   Wed, 04 Aug 2010 02:52:22 +0900
+
 libwww-perl (5.813-1) unstable; urgency=low
 
   * New upstream release.
only in patch2:
unchanged:
--- libwww-perl-5.813.orig/lib/LWP/Protocol/http.pm
+++ libwww-perl-5.813/lib/LWP/Protocol/http.pm
@@ -203,15 +203,16 @@
 #print "--\n$req_buf\n--\n";
 
 if (!$has_content || $write_wait || $has_content > 8*1024) {
-do {
+  WRITE:
+{
 # Since this just writes out the header block it should almost
 # always succeed to send the whole buffer in a single write call.
 my $n = $socket->syswrite($req_buf, length($req_buf));
 unless (defined $n) {
-redo if $!{EINTR};
+redo WRITE if $!{EINTR};
 if ($!{EAGAIN}) {
 select(undef, undef, undef, 0.1);
-redo;
+redo WRITE;
 }
 die "write failed: $!";
 }
@@ -221,8 +222,8 @@
 else {
 select(undef, undef, undef, 0.5);
 }
+redo WRITE if length $req_buf;
 }
-while (length $req_buf);
 }
 
 my($code, $mess, @junk);


Bug#591462: libwww-perl: redo; outside the scope of the module (LWP/Protocol/http.pm)

2010-08-03 Thread Jérémy Ruffet
Package: libwww-perl
Version: 5.813-1
Severity: normal
Tags: patch


Here is how to reproduce :
#!/usr/bin/perl -w
use strict;

use LWP::UserAgent;
use Switch;

my $browser = LWP::UserAgent->new();

sub called_once {
my $url = "http://www.lighttpd.net/"; . "/"x2**16;
print STDERR "1\n";
my $res = $browser->get($url);
print STDERR "2\n";
}

my $arg = "bug";
switch($arg) {
case "bug" {
&called_once;
}
}

Here is how it is corrected in squeeze's libwww-perl :
--- http-lenny.pm   2010-08-03 12:08:02.562469636 +0200
+++ http-as-in-squeeze.pm   2010-08-03 12:11:56.218409712 +0200
@@ -203,15 +203,16 @@
 #print "--\n$req_buf\n--\n";
 
 if (!$has_content || $write_wait || $has_content > 8*1024) {
-do {
+  WRITE:
+{
 # Since this just writes out the header block it should almost
 # always succeed to send the whole buffer in a single write call.
 my $n = $socket->syswrite($req_buf, length($req_buf));
 unless (defined $n) {
-redo if $!{EINTR};
+redo WRITE if $!{EINTR};
 if ($!{EAGAIN}) {
 select(undef, undef, undef, 0.1);
-redo;
+redo WRITE;
 }
 die "write failed: $!";
 }
@@ -221,8 +222,8 @@
 else {
 select(undef, undef, undef, 0.5);
 }
+redo WRITE if length $req_buf;
 }
-while (length $req_buf);
 }
 
 my($code, $mess, @junk);



-- System Information:
Debian Release: 5.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32.15-grsec-vs (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libwww-perl depends on:
ii  libhtml-parser-perl  3.56-1+lenny1   A collection of modules that parse
ii  libhtml-tagset-perl  3.20-2  Data tables pertaining to HTML
ii  libhtml-tree-perl3.23-1  represent and create HTML syntax t
ii  liburi-perl  1.35.dfsg.1-1   Manipulates and accesses URI strin
ii  netbase  4.34Basic TCP/IP networking system
ii  perl [libdigest-md5-perl 5.10.0-19lenny2 Larry Wall's Practical Extraction 

Versions of packages libwww-perl recommends:
ii  libcompress-zlib-perl 2.012-1Perl module for creation and manip
ii  libhtml-format-perl   2.04-2 format HTML syntax trees into text
ii  libmailtools-perl 2.03-1 Manipulate email in perl programs

Versions of packages libwww-perl suggests:
ii  libio-socket-ssl-perl  1.16-1+lenny1 Perl module implementing object or

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org