Bug#435656: Change in behaviour of gzreadline() caused debmirror to delete my whole mirror

Damyan Ivanov dam at modsoftsys.com
Fri Aug 3 14:22:46 UTC 2007


severity 435656 grave
thanks

Rationale: breaks unrelated software

-=| Peter Baumann,  3.08.2007 16:46 |=-
> On Fri, Aug 03, 2007 at 08:23:10AM +0300, Damyan Ivanov wrote:
>> The code above reads until either an empty $line appears, or $res is not
>> positive. Could it be possible that the file in question does no contain
>> empty lines and thus the inner while reads until EOF?
>>
>> Or, perhaps $line needs a chomp in order to match /^$/ ?
>> (yes, that would mean a behaviour change)
> 
> No. The file is fine (it is e.g dists/lenny/main/binary-i386/Packages.gz).
> But this gave me the right direction. Here is the output of the slighly
> changed code segment (output enclosed by '-' markers)
> 
>     my $gunzf = gzopen($file, "rb") or die "$file: $!";
>     my $line;
>     my $res;
>     my $loop = 1;
>     while ($loop) {
>       my $buf = "";
>       while(($res = $gunzf->gzreadline($line) > 0)
>            && !($line =~ /^$/)) {
>         printf "%u:%s", length($line), $line;
>         exit;
>         $buf = $buf . $line;
>       }
> 
> 
> 
> previous version (1.42-2):
> -
> 16:Package: 2vcard
> -
> 
> 
> new version (2.005-1)
> -
> 791:Package: 2vcard
> Priority: optional
> Section: utils
> Installed-Size: 108
> Maintainer: Martin Albisetti <argentina at gmail.com>
> Architecture: i386
> Version: 0.5-1
> Filename: pool/main/2/2vcard/2vcard_0.5-1_i386.deb
> Size: 14090
> MD5sum: 074de92c99657c98dff1ed42d580f84b
> SHA1: ceea35694c35437ad3f8a1e06ab7d3e698efee56
> SHA256: 814b27ae828b9947d63a1ce628c85e5fb36f95075f3ccdbd23c9c908e067fb6c
> Description: A little perl script to convert an addressbook to VCARD file format
>  2vcard is a little perl script that you can use to convert the popular vcard
>  file format. Currently 2vcard can only convert adressbooks and alias files from
>  the following formats: abook,eudora,juno,ldif,mutt,mh and pine.
>  .
>  The VCARD format is used by gnomecard, for example, which is turn is used by
>  the balsa email client.
> 
> -

Ouch! It seems only double \n's are detected?

Can you also print length($/) around there? Is it zero?

If it is, this could be the source of the problem - it seems
IO::Compress::Base (which actually implements the gzreadline function)
supports several modes, $/ == '' provoking the "paragraph mode".

I guess Compress::Zlib's gzreadline() should add "local $/ = ''" before
passing the call further to preserve the previous interface.

If you confirm that $/ is indeed empty and setting it to '\n' solves the
problem, I'll prepare a fix.
-- 
dam            JabberID: dam at jabber.minus273.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20070803/4dcf04bd/attachment.pgp 


More information about the pkg-perl-maintainers mailing list