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

Matt Sicker commented on COMPRESS-603:
--------------------------------------

I see two potential things that may be contributing to my initial issue:
 # In my affected code, I extract a tarball to a directory created via 
{{{}Files.createTempDirectory().toFile(){}}}; on Linux, this ends up somewhere 
in {{{}/tmp{}}}, though I wonder how this would work if the Java tmpdir is a 
symlink.
 # The affected tarball I was initially notified about has a more complex 
directory structure, but the exception was thrown when the {{./}} directory 
entry at the beginning of the tar file was attempted to be made. Running {{tar 
tf}} on the file shows something like:

{{./}}

{{./foo/}}

{{./foo/bar/}}

{{./foo/bar/baz.txt}}

> Expander does not support archives with archive entries beginning with ./
> -------------------------------------------------------------------------
>
>                 Key: COMPRESS-603
>                 URL: https://issues.apache.org/jira/browse/COMPRESS-603
>             Project: Commons Compress
>          Issue Type: Bug
>          Components: Archivers
>    Affects Versions: 1.21
>            Reporter: Matt Sicker
>            Priority: Major
>         Attachments: test.tar.gz
>
>
> Suppose I create a tar file from a directory like so:
>  
> {code:java}
> tar -cf foo.tar ./foo{code}
> When I try to extract the tar entries using the Expander class, that throws a 
> java.io.IOException: Expanding ./ would create file outside of ...
> When I create the tar file without the leading ./, then Expander doesn't 
> complain.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to