hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Lowe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-15170) Add symlink support to FileUtil#unTarUsingJava
Date Wed, 31 Jan 2018 17:16:00 GMT

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

Jason Lowe commented on HADOOP-15170:
-------------------------------------

Thanks for updating the patch!

I tested this out on a manually created a tarball with some symlinks and the link targets
are being mishandled.  For example:
{noformat}
$ mkdir testdir
$ cd testdir
$ ln -s a b
$ ln -s /tmp/foo c
$ ls -l
total 0
lrwxrwxrwx. 1 nobody nobody 1 Jan 31 10:40 b -> a
lrwxrwxrwx. 1 nobody nobody 8 Jan 31 10:40 c -> /tmp/foo
$ cd ..
$ tar zcf testdir.tgz testdir 
{noformat}
When I unpack this tarball to a destination directory of "output" with unTarUsingJava the
symlinks are all relative to the top-level output directory which is incorrect:
{noformat}
$ ls -l output/testdir
total 0
lrwxrwxrwx. 1 nobody nobody  8 Jan 31 10:41 b -> output/a
lrwxrwxrwx. 1 nobody nobody 14 Jan 31 10:41 c -> output/tmp/foo
{noformat}

The fix is to just take the symlink name as-is rather than trying to make it relative to something
else.

> Add symlink support to FileUtil#unTarUsingJava 
> -----------------------------------------------
>
>                 Key: HADOOP-15170
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15170
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>            Reporter: Jason Lowe
>            Assignee: Ajay Kumar
>            Priority: Minor
>         Attachments: HADOOP-15170.001.patch, HADOOP-15170.002.patch, HADOOP-15170.003.patch
>
>
> Now that JDK7 or later is required, we can leverage java.nio.Files.createSymbolicLink
in FileUtil.unTarUsingJava to support archives that contain symbolic links.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message