Skip Menu |

This queue is for tickets about the Archive-Tar CPAN distribution.

Report information
The Basics
Id: 17310
Status: resolved
Priority: 0/
Queue: Archive-Tar

People
Owner: Nobody in particular
Requestors: bevapost [...] pobox.sk
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.26
Fixed in: (no value)



Subject: Archive-Tar 1.26_01 not tolerant to Archives with Garbage
ActiveState Perl 5.8.7.815 D:\Perl5.8.7.815\bin>perl -v This is perl, v5.8.7 built for MSWin32-x86-multi-thread (with 14 registered patches, see perl -V for more detail) Copyright 1987-2005, Larry Wall Binary build 815 [211909] provided by ActiveState http://www.ActiveState.com ActiveState is a division of Sophos. Built Nov 2 2005 08:44:52 Archive-Tar 1.26.01 is not tolerant to Tar Archives with Garbage vvvvv D:\data_to_process\Perl5.8.7.8xx_TarTest>ptar -t -f 060123datacollst7r135.tar Couldn't read chunk at offset unknown at D:\Perl5.8.7.815\bin\ptar line 36 Can't call method "is_label" on an undefined value at D:/Perl5.8.7.815/site/lib/Archive/Tar.pm line 282. ^^^^^ The tar Archive contain Garbage after Last Record Last Tolerant Configuration: ActiveState Perl 5.6.1.638 Archive-Tar 1.08
Subject: Re: [rt.cpan.org #17310] AutoReply: Archive-Tar 1.26_01 not tolerant to Archives with Garbage
Date: Mon, 30 Jan 2006 08:22:05 +0100
To: bug-Archive-Tar [...] rt.cpan.org
From: "Bedrich Valenta" <bevapost [...] pobox.sk>
Additional Info: Tar.pm $VERSION = "1.08"; 232 # Apparently this should really be two blocks of 512 zeroes, 233 # but GNU tar sometimes gets it wrong. See comment in the 234 # source code (tar.c) to GNU cpio. 235 last if $chunk eq TAR_END; Tar.pm $VERSION = "1.26_01"; 260 ### Apparently this should really be two blocks of 512 zeroes, 261 ### but GNU tar sometimes gets it wrong. See comment in the 262 ### source code (tar.c) to GNU cpio. 263 next if $chunk eq TAR_END; My HP-UX Box leave tar Archives rubisch after two blocks of 512 zeroes. I guess this is the Reason why 1.08 work and 1.26.02 not Thanks Bedrich Valenta Show quoted text
>-----Pôvodná správa----- >Od: Bugs in Archive-Tar via RT [mailto:bug-Archive-Tar@rt.cpan.org] >Odoslané: 1. januára 0001 0:00 >Komu: bevapost@pobox.sk >Predmet: [rt.cpan.org #17310] AutoReply: Archive-Tar 1.26_01 not tolerant to Archives with Garbage > > > >Greetings, > >This message has been automatically generated in response to the >creation of a trouble ticket regarding: >"Archive-Tar 1.26_01 not tolerant to Archives with Garbage", >a summary of which appears below. > >There is no need to reply to this message right now. Your ticket has been >assigned an ID of [rt.cpan.org #17310]. > >Please include the string: > >[rt.cpan.org #17310] > >in the subject line of all future correspondence about this issue. To do so, >you may reply to this message. > >Thank you, >bug-Archive-Tar@rt.cpan.org > >------------------------------------------------------------------------- >ActiveState Perl 5.8.7.815 >D:\Perl5.8.7.815\bin>perl -v > >This is perl, v5.8.7 built for MSWin32-x86-multi-thread >(with 14 registered patches, see perl -V for more detail) > >Copyright 1987-2005, Larry Wall > >Binary build 815 [211909] provided by ActiveState >http://www.ActiveState.com >ActiveState is a division of Sophos. >Built Nov 2 2005 08:44:52 > >Archive-Tar 1.26.01 >is not tolerant to Tar Archives with Garbage > >vvvvv >D:\data_to_process\Perl5.8.7.8xx_TarTest>ptar -t -f >060123datacollst7r135.tar >Couldn't read chunk at offset unknown at D:\Perl5.8.7.815\bin\ptar >line 36 >Can't call method "is_label" on an undefined value at >D:/Perl5.8.7.815/site/lib/Archive/Tar.pm line 282. >^^^^^ > >The tar Archive contain Garbage after Last Record > > >Last Tolerant Configuration: >ActiveState Perl 5.6.1.638 >Archive-Tar 1.08
Aktivujte si neobmedzenu mailovu schranku na www.pobox.sk!
Subject: Re: [rt.cpan.org #17310] AutoReply: Archive-Tar 1.26_01 not tolerant to Archives with Garbage
Date: Mon, 30 Jan 2006 10:25:35 +0100
To: bug-Archive-Tar [...] rt.cpan.org
From: "Jos I. Boumans" <kane [...] xs4all.net>
On Jan 30, 2006, at 8:23 AM, bevapost@pobox.sk via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=17310 > > > Additional Info: > > Tar.pm > $VERSION = "1.08"; > 232 # Apparently this should really be two blocks of 512 zeroes, > 233 # but GNU tar sometimes gets it wrong. See comment in the > 234 # source code (tar.c) to GNU cpio. > 235 last if $chunk eq TAR_END; > > Tar.pm > $VERSION = "1.26_01"; > 260 ### Apparently this should really be two blocks of 512 > zeroes, > 261 ### but GNU tar sometimes gets it wrong. See comment in the > 262 ### source code (tar.c) to GNU cpio. > 263 next if $chunk eq TAR_END; > > My HP-UX Box leave tar Archives rubisch after two blocks of 512 zeroes. > I guess this is the Reason why 1.08 work and 1.26.02 not
Could you send me a sample .tar file from your HP-UX box? That might help me in fixing the issue. Something containing: $ mkdir x $ touch x/y $ tar -cf x.tar x would work just fine. And for documentation purposes: $ tar --version Thanks, -- Jos Boumans "You know you are never more indignant in life than when you're shopping at a store you feel is beneath you and one of the other customers mistakes you for one of the employees of that store." - Dennis Miller CPANPLUS http://cpanplus.sf.net
Subject: Re: Re: [rt.cpan.org #17310] AutoReply: Archive-Tar 1.26_01 not tolerant to Archives with Garbage
Date: Mon, 30 Jan 2006 11:30:18 +0100
To: bug-Archive-Tar [...] rt.cpan.org
From: "Bedrich Valenta" <bevapost [...] pobox.sk>
Hi, I have Created test1.tar dummy Archive. (attached) It contain Garbage at the end (as expected). HP-UX version 11.11 Thanks Bedrich Valenta Show quoted text
>-----Pôvodná správa----- >Od: Jos I. Boumans via RT [mailto:bug-Archive-Tar@rt.cpan.org] >Odoslané: 1. januára 0001 0:00 >Komu: bevapost@pobox.sk >Predmet: Re: [rt.cpan.org #17310] AutoReply: Archive-Tar 1.26_01 not tolerant to Archives with Garbage > > > >On Jan 30, 2006, at 8:23 AM, bevapost@pobox.sk via RT wrote: >
>> >> <URL: http://rt.cpan.org/Ticket/Display.html?id=17310 > >> >> Additional Info: >> >> Tar.pm >> $VERSION = "1.08"; >> 232 # Apparently this should really be two blocks of 512 zeroes, >> 233 # but GNU tar sometimes gets it wrong. See comment in the >> 234 # source code (tar.c) to GNU cpio. >> 235 last if $chunk eq TAR_END; >> >> Tar.pm >> $VERSION = "1.26_01"; >> 260 ### Apparently this should really be two blocks of 512 >> zeroes, >> 261 ### but GNU tar sometimes gets it wrong. See comment in the >> 262 ### source code (tar.c) to GNU cpio. >> 263 next if $chunk eq TAR_END; >> >> My HP-UX Box leave tar Archives rubisch after two blocks of 512 zeroes. >> I guess this is the Reason why 1.08 work and 1.26.02 not
> >Could you send me a sample .tar file from your HP-UX box? That might >help me in >fixing the issue. > >Something containing: > >$ mkdir x >$ touch x/y >$ tar -cf x.tar x > >would work just fine. And for documentation purposes: > >$ tar --version > >Thanks, > >-- > >Jos Boumans > >"You know you are never more indignant in life than when you're >shopping at a store you feel is beneath you and one of the other >customers mistakes you for one of the employees of that store." >- Dennis Miller > >CPANPLUS http://cpanplus.sf.net
Aktivujte si neobmedzenu mailovu schranku na www.pobox.sk!
Download test1.tar
application/x-tar 30k

Message body not shown because it is not plain text.

On Mon Jan 30 05:31:16 2006, bevapost@pobox.sk wrote: Show quoted text
> I have Created test1.tar dummy Archive. (attached) > It contain Garbage at the end (as expected).
Thanks for that archive.. it allowed me to track down the problem. It turns out archive::tar's garbage protection isn't as robust as it should be, but i've found a way to add another check, that at least tackles 'trailing garbage' well enough; ==== //member/kane/archive-tar-new/lib/Archive/Tar.pm#99 - /Users/kane/sources/p4/ other/archive-tar-new/lib/Archive/Tar.pm ==== 270a271,282 Show quoted text
> ### according to the posix spec, the last 12 bytes of the header are > ### null bytes, to pad it to a 512 byte block. That means if these > ### bytes are NOT null bytes, it's a corrrupt header. See: > ### www.koders.com/c/
fidCE473AD3D9F835D690259D60AD5654591D91D5BA.aspx Show quoted text
> ### line 111 > { my $nulls = join '', "\0" x 12; > unless( $nulls eq substr( $chunk, 500, 12 ) ) { > $self->_error( qq[Invalid header block at offset $offset] ); > next LOOP; > } > } >
This seems to effectively stop any garbage being produced from the archive you provided... a simple ptar on it now warns about the invalid headers, but operates normally otherwise: $ perl bin/ptar -t -f /tmp/test1.tar Invalid header block at offset unknown at bin/ptar line 36 Invalid header block at offset unknown at bin/ptar line 36 Invalid header block at offset unknown at bin/ptar line 36 Invalid header block at offset unknown at bin/ptar line 36 Invalid header block at offset unknown at bin/ptar line 36 Invalid header block at offset unknown at bin/ptar line 36 Invalid header block at offset unknown at bin/ptar line 36 Invalid header block at offset unknown at bin/ptar line 36 Invalid header block at offset unknown at bin/ptar line 36 Invalid header block at offset unknown at bin/ptar line 36 Invalid header block at offset unknown at bin/ptar line 36 /var/adm/new._ACL /var/adm/new._OWNER /var/adm/new._PROD_DFLT_ACL /var/adm/new._SOC_DFLT_ACL /var/adm/new.secrets /var/adm/cleanup.log I'll be adding this fix to A::T 1.29, which will be released shortly. Thanks for reporting,
From: manju_putcha [...] yahoo.com
I am using Archive-Tar 1.29, still get the same error for the follwing zip file. Please help? M On Fri Mar 03 08:39:56 2006, KANE wrote: Show quoted text
> On Mon Jan 30 05:31:16 2006, bevapost@pobox.sk wrote: >
> > I have Created test1.tar dummy Archive. (attached) > > It contain Garbage at the end (as expected).
> > Thanks for that archive.. it allowed me to track down the problem. > It turns out archive::tar's garbage protection isn't as robust as it > should be, > but i've found a way to add another check, that at least tackles > 'trailing > garbage' well enough; > > ==== //member/kane/archive-tar-new/lib/Archive/Tar.pm#99 - > /Users/kane/sources/p4/ > other/archive-tar-new/lib/Archive/Tar.pm ==== > 270a271,282
> > ### according to the posix spec, the last 12 bytes of the
> header are
> > ### null bytes, to pad it to a 512 byte block. That means if
> these
> > ### bytes are NOT null bytes, it's a corrrupt header. See: > > ### www.koders.com/c/
> fidCE473AD3D9F835D690259D60AD5654591D91D5BA.aspx
> > ### line 111 > > { my $nulls = join '', "\0" x 12; > > unless( $nulls eq substr( $chunk, 500, 12 ) ) { > > $self->_error( qq[Invalid header block at offset
> $offset] );
> > next LOOP; > > } > > } > >
> > This seems to effectively stop any garbage being produced from the > archive you provided... a simple ptar on it now warns about the > invalid > headers, but operates normally otherwise: > > $ perl bin/ptar -t -f /tmp/test1.tar > Invalid header block at offset unknown at bin/ptar line 36 > Invalid header block at offset unknown at bin/ptar line 36 > Invalid header block at offset unknown at bin/ptar line 36 > Invalid header block at offset unknown at bin/ptar line 36 > Invalid header block at offset unknown at bin/ptar line 36 > Invalid header block at offset unknown at bin/ptar line 36 > Invalid header block at offset unknown at bin/ptar line 36 > Invalid header block at offset unknown at bin/ptar line 36 > Invalid header block at offset unknown at bin/ptar line 36 > Invalid header block at offset unknown at bin/ptar line 36 > Invalid header block at offset unknown at bin/ptar line 36 > /var/adm/new._ACL > /var/adm/new._OWNER > /var/adm/new._PROD_DFLT_ACL > /var/adm/new._SOC_DFLT_ACL > /var/adm/new.secrets > /var/adm/cleanup.log > > I'll be adding this fix to A::T 1.29, which will be released shortly. > > Thanks for reporting,
Download x.gz
application/x-gzip 2.9k

Message body not shown because it is not plain text.

#!/usr/local/bin/perl -w use lib qw(/export/home/mputcha/Archive-Tar-1.29); use strict; use LogUtil; use Archive::Tar; my $tar = Archive::Tar->new; if( Archive::Tar->can_handle_compressed_files){ $tar->read('x.gz',1); } else{ print "CANT HANDLE\n"; }
Subject: Re: [rt.cpan.org #17310] Archive-Tar 1.26_01 not tolerant to Archives with Garbage
Date: Mon, 15 May 2006 22:59:00 +0200 (CEST)
To: bug-Archive-Tar [...] rt.cpan.org
From: kane [...] xs4all.nl
Show quoted text
> Queue: Archive-Tar > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=17310 > > > I am using Archive-Tar 1.29, still get the same error for the follwing > zip file. Please help?
The file you attached is a gzip compressed file.. NOT a tar compressed file. Archive::tar only handles tar files, with optional gzip compression. You want IO::Zlib or Compress::Zlib to do this task for you.