hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Nauroth (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-9043) winutils can create unusable symlinks
Date Thu, 15 Nov 2012 07:18:12 GMT

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

Chris Nauroth commented on HADOOP-9043:
---------------------------------------

This is best illustrated through an example.  See below.  Suppose there is a file at foo\bar\hello.txt,
and you want to create a symlink to it named hello.txt in the current directory.  Running
"winutils symlink hello.txt foo\bar\hello.txt" (using back slashes) works correctly.  However,
running "winutils symlink hello.txt foo/bar/hello.txt" (using forward slashes) appears to
succeed, but then the file isn't really accessible through the symlink.

This is a minor winutils bug.  The Java codebase is supposed to take care of calling winutils
with the correct path separator.  This does make it more challenging to troubleshoot problems,
because the failure doesn't occur at the source of the problem (symlink creation).  Instead,
the failure occurs later when a process tries to access a file through the symlink.

This shows that winutils generally rejects attempts to create dangling symlinks.

{code}
C:\test2>\dep\hadoop-3.0.0-SNAPSHOT\bin\winutils.exe symlink baz doesNotExist
DirectoryCheck error (2): The system cannot find the file specified.

C:\test2>\dep\hadoop-3.0.0-SNAPSHOT\bin\winutils.exe symlink baz subdir\doesNotExist
DirectoryCheck error (3): The system cannot find the path specified.
{code}

This shows that passing forward slashes can create a bad symlink.

{code}
C:\test2>dir
 Volume in drive C has no label.
 Volume Serial Number is 9898-B272

 Directory of C:\test2

11/14/2012  12:24 PM    <DIR>          .
11/14/2012  12:24 PM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)   5,014,097,920 bytes free

C:\test2>mkdir foo\bar

C:\test2>echo hello > foo\bar\hello.txt

C:\test2>\dep\hadoop-3.0.0-SNAPSHOT\bin\winutils.exe symlink hello.txt foo\bar\h
ello.txt

C:\test2>dir
 Volume in drive C has no label.
 Volume Serial Number is 9898-B272

 Directory of C:\test2

11/14/2012  12:24 PM    <DIR>          .
11/14/2012  12:24 PM    <DIR>          ..
11/14/2012  12:24 PM    <DIR>          foo
11/14/2012  12:24 PM    <SYMLINK>      hello.txt [foo\bar\hello.txt]
               1 File(s)              0 bytes
               3 Dir(s)   5,014,097,920 bytes free

C:\test2>type hello.txt
hello

C:\test2>del hello.txt

C:\test2>\dep\hadoop-3.0.0-SNAPSHOT\bin\winutils.exe symlink hello.txt foo/bar/h
ello.txt

C:\test2>dir
 Volume in drive C has no label.
 Volume Serial Number is 9898-B272

 Directory of C:\test2

11/14/2012  12:24 PM    <DIR>          .
11/14/2012  12:24 PM    <DIR>          ..
11/14/2012  12:24 PM    <DIR>          foo
11/14/2012  12:24 PM    <SYMLINK>      hello.txt [foo/bar/hello.txt]
               1 File(s)              0 bytes
               3 Dir(s)   5,014,097,920 bytes free

C:\test2>type hello.txt
The system cannot find the file specified.
{code}

                
> 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: Chris Nauroth
>
> 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

Mime
View raw message