hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Mitic (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-9043) winutils can create unusable symlinks
Date Thu, 21 Feb 2013 00:59:13 GMT

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

Ivan Mitic commented on HADOOP-9043:

Thanks Arpit!

I just looked at the patch, and I would prefer we go a slightly different route.

We should always assume that paths that enter winutils have only backshashes. The translation
(/ -> \) should be happening on the Java side. To fix this specific problem, we would want
to change FileUtil#symlink to "normalize the slashes". If you take a look at the branch-1-win
code, it already does this so you can just forward port the patch.

Does this make sense, or am I missing something?

FileUtil APIs and APIs that work with local file system in general should be accepting java.io.File
for params that are local files (instead of Strings or Paths), so that we can let Java handle
cross platform path "normalization". Deprecating existing APIs would be an overhead especially
for projects that tool a dependency, so we should just keep this in mind going forward for
the new APIs we add.
> winutils can create unusable symlinks
> -------------------------------------
>                 Key: HADOOP-9043
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9043
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 1-win, trunk-win
>            Reporter: Chris Nauroth
>            Assignee: Arpit Agarwal
>         Attachments: HADOOP-9043.branch-1-win.patch, HADOOP-9043.trunk.patch
> In general, the winutils symlink command rejects attempts to create symlinks targeting
a destination file that does not exist.  However, if given a symlink destination with forward
slashes pointing at a file that does exist, then it creates the symlink with the forward slashes,
and then attempts to open the file through the symlink will fail.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message