$DEBUG = 0;
$WARN = 1;
$FOLLOW_SYMLINK = 0;
-$VERSION = "1.46";
+$VERSION = "1.48";
$CHOWN = 1;
$CHMOD = 1;
$DO_NOT_USE_PREFIX = 0;
$self->_error( qq[Cannot read compressed format in tar-mode] );
return;
}
+
+ ### size is < HEAD, which means a corrupted file, as the minimum
+ ### length is _at least_ HEAD
+ if (length $chunk != HEAD) {
+ $self->_error( qq[Cannot read enough bytes from the tarfile] );
+ return;
+ }
}
### if we can't read in all bytes... ###
ok( $file->validate, " File validates" );
}
}
+
+### return error properly on corrupted archives
+### Addresses RT #44680: Improve error reporting on short corrupted archives
+{ ok( 1, "Testing bug 44680" );
+
+ { ### XXX whitebox test -- resetting the error string
+ no warnings 'once';
+ $Archive::Tar::error = "";
+ }
+
+ my $src = File::Spec->catfile( qw[src short b] );
+ my $tar = $Class->new;
+
+ isa_ok( $tar, $Class, " Object" );
+
+
+ ### we quell the error on STDERR
+ local $Archive::Tar::WARN = 0;
+
+ ok( !$tar->read( $src ), " No files in the corrupted archive" );
+ like( $tar->error, qr/enough bytes/,
+ " Expected error reported" );
+}
+
uupacktool.pl -p lib/Archive/Tar/t/src/header/signed.tar lib/Archive/Tar/t/src/header/signed.tar.packed
-Created at Thu Mar 5 17:07:54 2009
+Created at Tue Apr 21 11:50:41 2009
#########################################################################
__UU__
MPZ3#I,.D````````````````````````````````````````````````````
uupacktool.pl -p lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar lib/Archive/Tar/t/src/linktest/linktest_missing_dir.tar.packed
-Created at Thu Mar 5 17:07:54 2009
+Created at Tue Apr 21 11:50:42 2009
#########################################################################
__UU__
M;&EN:W1E<W0O;&EN:P``````````````````````````````````````````
uupacktool.pl -p lib/Archive/Tar/t/src/linktest/linktest_with_dir.tar lib/Archive/Tar/t/src/linktest/linktest_with_dir.tar.packed
-Created at Thu Mar 5 17:07:54 2009
+Created at Tue Apr 21 11:50:42 2009
#########################################################################
__UU__
M;&EN:W1E<W0O;W)I9R\`````````````````````````````````````````
uupacktool.pl -p lib/Archive/Tar/t/src/long/bar.tar lib/Archive/Tar/t/src/long/bar.tar.packed
-Created at Thu Mar 5 17:07:54 2009
+Created at Tue Apr 21 11:50:42 2009
#########################################################################
__UU__
M8P``````````````````````````````````````````````````````````
uupacktool.pl -p lib/Archive/Tar/t/src/long/foo.tbz lib/Archive/Tar/t/src/long/foo.tbz.packed
-Created at Thu Mar 5 17:07:54 2009
+Created at Tue Apr 21 11:50:42 2009
#########################################################################
__UU__
M0EIH.3%!62936=873NT``9C_A._0`DA``_^`0`0)`._OGJ```40(,`%X9`8`
uupacktool.pl -p lib/Archive/Tar/t/src/long/foo.tgz lib/Archive/Tar/t/src/long/foo.tgz.packed
-Created at Thu Mar 5 17:07:54 2009
+Created at Tue Apr 21 11:50:42 2009
#########################################################################
__UU__
M'XL(`````````^W72VZ#,!`&8*]S"BY`F,$/MCT`ET")25`<D"A1Q.UKR*M1
uupacktool.pl -p lib/Archive/Tar/t/src/short/bar.tar lib/Archive/Tar/t/src/short/bar.tar.packed
-Created at Thu Mar 5 17:07:54 2009
+Created at Tue Apr 21 11:50:42 2009
#########################################################################
__UU__
M8P``````````````````````````````````````````````````````````
uupacktool.pl -p lib/Archive/Tar/t/src/short/foo.tbz lib/Archive/Tar/t/src/short/foo.tbz.packed
-Created at Thu Mar 5 17:07:54 2009
+Created at Tue Apr 21 11:50:42 2009
#########################################################################
__UU__
M0EIH.3%!62936>GH,8X``)O[A.90`D!``'^```#O*1X```%`""``E(*JGDA#
uupacktool.pl -p lib/Archive/Tar/t/src/short/foo.tgz lib/Archive/Tar/t/src/short/foo.tgz.packed
-Created at Thu Mar 5 17:07:54 2009
+Created at Tue Apr 21 11:50:42 2009
#########################################################################
__UU__
M'XL(`````````^W300K",!"%X5GW%#G"3-JFYREJ080NJKU_A^A"$.RJ(\+_