cloudsmith/geppetto — Issue #285: It is sometimes impossible to unpack forge modules created as GNU tar files
Author: thallgren
Created: 2012-02-09 07:37:23+00:00
State: open

GNU tar puts binary encoded numbers in the tar header when the number is very large. Apparently this sometimes affects the uid and gid header fields. When that happens, the Apache commons compress Tar archiver fails to unpack. Instead we get an exception like:

```
java.lang.IllegalArgumentException: Invalid byte 1 at offset 7 in
'�{NUL}{NUL}{NUL}R' len=8
at org.apache.commons.compress.archivers.tar.TarUtils.parseOctal(TarUtils.java:86)
at org.apache.commons.compress.archivers.tar.TarArchiveEntry.parseTarHeader(TarArchiveEntry.java:788)
at org.apache.commons.compress.archivers.tar.TarArchiveEntry.(TarArchiveEntry.java:308)
at org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:198)
at org.cloudsmith.geppetto.forge.util.TarUtils.unpack(TarUtils.java:150)
at org.cloudsmith.geppetto.forge.impl.ForgeImpl.install(ForgeImpl.java:378)
```
I fixed the problem and provided a patch to Apache commons:

https://issues.apache.org/jira/browse/COMPRESS-175