[ 
https://issues.apache.org/jira/browse/COMPRESS-558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17231450#comment-17231450
 ] 

Peter Lee commented on COMPRESS-558:
------------------------------------

Hi [~rschimpf]. Great catch!

This problem is caused by the incomplete fix of COMPRESS-509 and this fix looks 
good to me.

Thank you for your contribution. :)

> Current master fails to extract ActiveMQ tar archive
> ----------------------------------------------------
>
>                 Key: COMPRESS-558
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-558
>             Project: Commons Compress
>          Issue Type: Bug
>    Affects Versions: 1.21
>            Reporter: Robin Schimpf
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> While version 1.20 is able to extract the ActiveMQ tar archive which can be 
> found here ([https://activemq.apache.org/components/classic/download/]) the 
> current master fails at extracting it with the following exception
> {code:java}
> java.io.IOException: Error detected parsing the header
>       at 
> org.apache.commons.compress.archivers.tar.TarArchiveInputStream.getNextTarEntry(TarArchiveInputStream.java:385)
> {code}
> I made a bisect search and this reveals the error is introduced with 
> COMPRESS-509. I made an analysis and found the following why the problem 
> appears
>  * Error ist thrown after reading a file in the tar but the file has a "/" at 
> the end
>  * In the currEntry.isGNULongNameEntry the currEntry.isDirectory evaluates to 
> true for this file -> reason why the "/" is appended
>  * The underlying problem is that isDirectory also checks if the entry has a 
> "/" at the end. But the decoded file name is not yet set in the currEntry. 
> Since the entry before the file is a folder the name ends with "/" and 
> isDirectory returns the wrong value
> Since I already came this far I'll send a pulll request where the decoded 
> name is set before checking if we need to append "/" to the entry name. With 
> this change the ActiveMQ tar can be extracted correctly again.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to