venj / theunarchiver

Automatically exported from code.google.com/p/theunarchiver
Other
0 stars 0 forks source link

Handle mislabeled GNU tar files #204

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The Unarchiver (verified in version 2.0.3) fails to properly extract files
with long pathnames in GZIPped TAR files; it appears that the limit is 100
characters in a pathname (including the filename).  In the case of the
attached file -- the installer for Genuitec Pulse
(http://www.poweredbypulse.com/) -- this leads to an installer that can't
find one of its support libraries.

The relevant directory in the attached file is:

pulse2-2.5.1.v200909091800-macosx/plugins/org.eclipse.equinox.launcher.carbon.ma
cosx_1.0.101.R34x_v20080731/

Using The Unarchiver, this directory ends up extracted as:

pulse2-2.5.1.v200909091800-macosx/plugins/org.eclipse.equinox.launcher.carbon.ma
cosx_1.0.101.R34x_v2/

and none of its contents are extracted.

Using the OS X built-in extractor, and the command-line command (tar xzvf),
both lead to proper extraction of the file.

Original issue reported on code.google.com by jlev...@gmail.com on 6 Oct 2009 at 5:29

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by paracel...@gmail.com on 6 Oct 2009 at 6:05

GoogleCodeExporter commented 9 years ago
Apparently this tar file is broken, and that's why it won't work. The parser 
will need to 
be updated to be more forgiving about invalid files. I am not maintaining this 
particular 
code, so I'll wait for a fix from the actual author.

Original comment by paracel...@gmail.com on 6 Oct 2009 at 6:20

GoogleCodeExporter commented 9 years ago
The tar file is created using the ant tar task on linux.

http://ant.apache.org/manual/CoreTasks/tar.html

I did some searching and found this, not sure if it's exactly the issue, but it
sounds related.

https://issues.apache.org/bugzilla/show_bug.cgi?id=47653

Original comment by JedKCAnd...@gmail.com on 6 Oct 2009 at 10:24

GoogleCodeExporter commented 9 years ago
Yes, that sounds like the exact issue.

Original comment by paracel...@gmail.com on 6 Oct 2009 at 10:43

GoogleCodeExporter commented 9 years ago
TarOutputStream out = new TarOutputStream(new GZIPOutputStream(new
BufferedOutputStream(new FileOutputStream(targetFile))));
out.setLongFileMode(TarOutputStream.LONGFILE_GNU);

The actual code used is the following.  Note we are not using ANT for at least 
one of
the bundles that fails with The Unarchiver so it appears to be a more general 
issue
of the way that Java itself creates tar output streams with long file names.

Original comment by trw...@gmail.com on 7 Oct 2009 at 1:58

GoogleCodeExporter commented 9 years ago
First of all thanks to Lorenz for spotting the source of the Bug in Ant, it has 
been
fixed there by now.

There is no "way that Java itself creates tar output streams" since java doesn't
support the tar format via the standard class library.  If you are creating tar
archives from Java you are likely using Tim Endress' tar classes (which inspired
Ant's tar classes in 1999) or an offspring of Ants tar classes like the apache
Commons Compress code base - which has now been fixed as well.

The code snippet in comment 5 looks exactly as if it was using Ant's tar code.

Original comment by stefan.b...@gmail.com on 8 Oct 2009 at 12:16

GoogleCodeExporter commented 9 years ago
Excellent, thanks. We'll try to get parsing for whatever archives are already 
out there 
working on this side too.

Original comment by paracel...@gmail.com on 8 Oct 2009 at 4:13

GoogleCodeExporter commented 9 years ago
Issue 222 has been merged into this issue.

Original comment by paracel...@gmail.com on 29 Nov 2009 at 11:20

GoogleCodeExporter commented 9 years ago
Issue 241 has been merged into this issue.

Original comment by paracel...@gmail.com on 13 Apr 2010 at 8:06

GoogleCodeExporter commented 9 years ago
Applied patch by halcy that fixes this.

Original comment by paracel...@gmail.com on 13 Apr 2010 at 8:38