Hello community, here is the log from the commit of package perl checked in at Wed Dec 20 22:05:06 CET 2006. -------- --- perl/perl.changes 2006-02-17 15:28:31.000000000 +0100 +++ /mounts/work_src_done/STABLE/perl/perl.changes 2006-12-20 21:19:53.000000000 +0100 @@ -1,0 +2,8 @@ +Wed Dec 20 21:17:03 CET 2006 - jw@suse.de + +- graceful-net-ftp patch added. + Lousy FTP server responses could trigger silly error messages in Net::FTP + and had no usable status_line in LWP. + Now it is 500 + whatever message the server responded. + +------------------------------------------------------------------- New: ---- perl-gracefull-net-ftp.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl.spec ++++++ --- /var/tmp/diff_new_pack.4InGrj/_old 2006-12-20 22:02:44.000000000 +0100 +++ /var/tmp/diff_new_pack.4InGrj/_new 2006-12-20 22:02:44.000000000 +0100 @@ -13,7 +13,7 @@ Name: perl BuildRequires: db-devel -License: GPL, Artistic License +License: Artistic License, GNU General Public License (GPL) Group: Development/Languages/Perl Provides: perl-500 perl-base perl-Digest perl-Digest-MD5 perl-Filter-Simple perl-I18N-LangTags perl-MIME-Base64 perl-Storable perl-Test-Simple perl-Text-Balanced perl-Time-HiRes perl-libnet Obsoletes: perl-Digest perl-Digest-MD5 perl-Filter-Simple perl-I18N-LangTags perl-MIME-Base64 perl-Storable perl-Test-Simple perl-Text-Balanced perl-Time-HiRes perl-libnet @@ -21,10 +21,11 @@ PreReq: %fillup_prereq Autoreqprov: on Version: 5.8.8 -Release: 4 +Release: 34 Summary: The Perl interpreter Source: perl-%{version}.tar.bz2 Patch: perl-%{version}.dif +Patch1: perl-gracefull-net-ftp.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -48,6 +49,7 @@ %prep %setup -q -n perl-5.8.8 %patch +%patch1 -p1 %build options="-Doptimize='$RPM_OPT_FLAGS -Wall -pipe'" @@ -118,6 +120,11 @@ %ghost %doc /usr/share/man/man3/perllocal.3pm.gz %changelog -n perl +* Wed Dec 20 2006 - jw@suse.de +- graceful-net-ftp patch added. + Lousy FTP server responses could trigger silly error messages in Net::FTP + and had no usable status_line in LWP. + Now it is 500 + whatever message the server responded. * Fri Feb 17 2006 - mls@suse.de - suppress prototype warning in autouse [#151459] * Wed Feb 01 2006 - mls@suse.de ++++++ perl-gracefull-net-ftp.diff ++++++ This patch avoids several silly warnings, and fills $res->status_line with something useful in case your FTP server babbles some text message without a leading response code. Seen from ftp.opensuse.org: connect(3, {sa_family=AF_INET, sin_port=htons(21), sin_addr=inet_addr("195.135.221.134")}, 16) = 0 read(3, "This server is busy, please try again later or any of my mirrors: http://download.opensuse.org\n\n", 1024) = 96 Note the missing "500 " before "This". Command line ftp clients handle this gracefully, so should we. With this patch, LWP clients see a status_line of "500 This server is busy, ..." 2006-12-20, jw@suse.de --- perl-5.8.8/lib/Net/FTP.pm.orig 2006-12-20 21:09:01.075906000 +0100 +++ perl-5.8.8/lib/Net/FTP.pm 2006-12-20 21:09:17.324643000 +0100 @@ -119,7 +119,7 @@ unless ($ftp->response() == CMD_OK) { $ftp->close(); - $@ = $ftp->message; + $@ = $ftp->message || $@; # keep @$ if no message. Happens, when response did not start with a code. undef $ftp; } @@ -1107,7 +1107,7 @@ sub response { my $ftp = shift; - my $code = $ftp->SUPER::response(); + my $code = $ftp->SUPER::response() || 5; # assume 500 if undef delete ${*$ftp}{'net_ftp_pasv'} if ($code != CMD_MORE && $code != CMD_INFO); @@ -1122,9 +1122,11 @@ my $ftp = shift; + # Darn MS FTP server is a load of CRAP !!!! + # Expect to see undef here. return () - unless ${*$ftp}{'net_cmd_code'} + 0; + unless 0 + (${*$ftp}{'net_cmd_code'}||0); (${*$ftp}{'net_cmd_code'},1); } --- perl-5.8.8/lib/Net/Cmd.pm.orig 2006-12-20 21:09:05.850129000 +0100 +++ perl-5.8.8/lib/Net/Cmd.pm 2006-12-20 21:09:17.332631000 +0100 @@ -338,9 +338,11 @@ if ($cmd->debug); ($code,$more) = $cmd->parse_response($str); + unless(defined $code) { $cmd->ungetline($str); + $@ = $str; # $@ is used as a tunneling hack. last; } @@ -351,6 +353,7 @@ last unless($more); } + return undef unless defined $code; substr($code,0,1); } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org