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

Ivan Mitic commented on HADOOP-9043:
------------------------------------

Thanks Chris for the writeup on readLink! The approach overall looks good. I 
have a few comments that should help with further progress:
1. There is no need to support junction points. Let's only focus on symlinks. 
We've seen problems with junction points on Windows for paths longer than 126 
chars (IIRC) and finally decided to stay out of supporting them. 
2. In winutils we already have SymbolicLinkCheck function which checks if the 
given path is a symlink. See if you can reconcile this with the new code.
3. DeviceIoControl is one way to retrieve the symlink target path. 
GetFinalPathNameByHandle provides the similar functionality and might be easier 
to use. See which one suits you better. (it is fine to assume that we’re 
running on Vista or later Windows OS).


Also a few comments on the latest patch:
1. RawLocalFs: An incremental improvement would be to have 
getPathWithoutSchemeAndAuthority return a File instead of a string.
2. Would you mind adding a unittest to TestWinUtils that targets the scenario 
where input paths have forward slashes (for both the target and the link).
3. TestLocalFSFileContextSymlink: Can you add a short comment in the first 
assert saying that dangling links are currently not supported on Windows for 
LocalFS.
4. Please also include a few winutils unittests for the new readLink API. 
                
> 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: 3.0.0, 1-win
>            Reporter: Chris Nauroth
>            Assignee: Arpit Agarwal
>             Fix For: 3.0.0, 1-win
>
>         Attachments: HADOOP-9043.branch-1.2.patch, 
> HADOOP-9043.branch-1-win.patch, HADOOP-9043.trunk.2.patch, 
> HADOOP-9043.trunk.3.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

Reply via email to