You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Robert Fuller (JIRA)" <ji...@apache.org> on 2012/07/25 16:22:35 UTC

[jira] [Created] (HADOOP-8621) FileUtil.symLink fails if spaces in path

Robert Fuller created HADOOP-8621:
-------------------------------------

             Summary: FileUtil.symLink fails if spaces in path
                 Key: HADOOP-8621
                 URL: https://issues.apache.org/jira/browse/HADOOP-8621
             Project: Hadoop Common
          Issue Type: Bug
            Reporter: Robert Fuller
            Priority: Minor


the 'ln -s' command fails in the current implementation if there is a space in the path for the target or linkname. A small change resolves the issue.

String cmd = "ln -s " + target + " " + linkname;
//Process p = Runtime.getRuntime().exec(cmd, null); //broken
Process p = Runtime.getRuntime().exec(new String[]{"ln","-s",target,linkname}, null);


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8621) FileUtil.symLink fails if spaces in path

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422669#comment-13422669 ] 

Hudson commented on HADOOP-8621:
--------------------------------

Integrated in Hadoop-Hdfs-trunk-Commit #2586 (See [https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2586/])
    Amend previous commit of HDFS-3626: accidentally included a hunk from HADOOP-8621 in svn commit. Reverting that hunk (Revision 1365817)

     Result = SUCCESS
todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1365817
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java

                
> FileUtil.symLink fails if spaces in path
> ----------------------------------------
>
>                 Key: HADOOP-8621
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8621
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Robert Fuller
>            Priority: Minor
>         Attachments: patch.txt
>
>
> the 'ln -s' command fails in the current implementation if there is a space in the path for the target or linkname. A small change resolves the issue.
> String cmd = "ln -s " + target + " " + linkname;
> //Process p = Runtime.getRuntime().exec(cmd, null); //broken
> Process p = Runtime.getRuntime().exec(new String[]{"ln","-s",target,linkname}, null);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HADOOP-8621) FileUtil.symLink fails if spaces in path

Posted by "Robert Fuller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8621?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Fuller updated HADOOP-8621:
----------------------------------

    Attachment: patch.txt

example fix attached.
                
> FileUtil.symLink fails if spaces in path
> ----------------------------------------
>
>                 Key: HADOOP-8621
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8621
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Robert Fuller
>            Priority: Minor
>         Attachments: patch.txt
>
>
> the 'ln -s' command fails in the current implementation if there is a space in the path for the target or linkname. A small change resolves the issue.
> String cmd = "ln -s " + target + " " + linkname;
> //Process p = Runtime.getRuntime().exec(cmd, null); //broken
> Process p = Runtime.getRuntime().exec(new String[]{"ln","-s",target,linkname}, null);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8621) FileUtil.symLink fails if spaces in path

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13423086#comment-13423086 ] 

Hudson commented on HADOOP-8621:
--------------------------------

Integrated in Hadoop-Mapreduce-trunk #1148 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1148/])
    Amend previous commit of HDFS-3626: accidentally included a hunk from HADOOP-8621 in svn commit. Reverting that hunk (Revision 1365817)

     Result = FAILURE
todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1365817
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java

                
> FileUtil.symLink fails if spaces in path
> ----------------------------------------
>
>                 Key: HADOOP-8621
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8621
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Robert Fuller
>            Priority: Minor
>         Attachments: hadoop-8621.txt, patch.txt
>
>
> the 'ln -s' command fails in the current implementation if there is a space in the path for the target or linkname. A small change resolves the issue.
> String cmd = "ln -s " + target + " " + linkname;
> //Process p = Runtime.getRuntime().exec(cmd, null); //broken
> Process p = Runtime.getRuntime().exec(new String[]{"ln","-s",target,linkname}, null);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8621) FileUtil.symLink fails if spaces in path

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422682#comment-13422682 ] 

Hudson commented on HADOOP-8621:
--------------------------------

Integrated in Hadoop-Common-trunk-Commit #2522 (See [https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2522/])
    Amend previous commit of HDFS-3626: accidentally included a hunk from HADOOP-8621 in svn commit. Reverting that hunk (Revision 1365817)

     Result = SUCCESS
todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1365817
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java

                
> FileUtil.symLink fails if spaces in path
> ----------------------------------------
>
>                 Key: HADOOP-8621
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8621
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Robert Fuller
>            Priority: Minor
>         Attachments: patch.txt
>
>
> the 'ln -s' command fails in the current implementation if there is a space in the path for the target or linkname. A small change resolves the issue.
> String cmd = "ln -s " + target + " " + linkname;
> //Process p = Runtime.getRuntime().exec(cmd, null); //broken
> Process p = Runtime.getRuntime().exec(new String[]{"ln","-s",target,linkname}, null);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8621) FileUtil.symLink fails if spaces in path

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422583#comment-13422583 ] 

Todd Lipcon commented on HADOOP-8621:
-------------------------------------

Hey Robert. Thanks for noticing the bug and the fix. It looks good to me.

Would you mind adding a simple unit test in ./src/test/java/org/apache/hadoop/fs/TestFileUtil.java? It seems like it should be trivial to mkdir a directory with a space in the path and try to create a symlink.

Also, when you generate a patch, best to generate it relative to the SVN root so the automatic patch tester can build it. Thanks!
                
> FileUtil.symLink fails if spaces in path
> ----------------------------------------
>
>                 Key: HADOOP-8621
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8621
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Robert Fuller
>            Priority: Minor
>         Attachments: patch.txt
>
>
> the 'ln -s' command fails in the current implementation if there is a space in the path for the target or linkname. A small change resolves the issue.
> String cmd = "ln -s " + target + " " + linkname;
> //Process p = Runtime.getRuntime().exec(cmd, null); //broken
> Process p = Runtime.getRuntime().exec(new String[]{"ln","-s",target,linkname}, null);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8621) FileUtil.symLink fails if spaces in path

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422719#comment-13422719 ] 

Hudson commented on HADOOP-8621:
--------------------------------

Integrated in Hadoop-Mapreduce-trunk-Commit #2542 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2542/])
    Amend previous commit of HDFS-3626: accidentally included a hunk from HADOOP-8621 in svn commit. Reverting that hunk (Revision 1365817)

     Result = FAILURE
todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1365817
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java

                
> FileUtil.symLink fails if spaces in path
> ----------------------------------------
>
>                 Key: HADOOP-8621
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8621
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Robert Fuller
>            Priority: Minor
>         Attachments: patch.txt
>
>
> the 'ln -s' command fails in the current implementation if there is a space in the path for the target or linkname. A small change resolves the issue.
> String cmd = "ln -s " + target + " " + linkname;
> //Process p = Runtime.getRuntime().exec(cmd, null); //broken
> Process p = Runtime.getRuntime().exec(new String[]{"ln","-s",target,linkname}, null);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HADOOP-8621) FileUtil.symLink fails if spaces in path

Posted by "Robert Fuller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8621?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Fuller updated HADOOP-8621:
----------------------------------

    Attachment: hadoop-8621.txt

Adding patch with unit test and fix.
                
> FileUtil.symLink fails if spaces in path
> ----------------------------------------
>
>                 Key: HADOOP-8621
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8621
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Robert Fuller
>            Priority: Minor
>         Attachments: hadoop-8621.txt, patch.txt
>
>
> the 'ln -s' command fails in the current implementation if there is a space in the path for the target or linkname. A small change resolves the issue.
> String cmd = "ln -s " + target + " " + linkname;
> //Process p = Runtime.getRuntime().exec(cmd, null); //broken
> Process p = Runtime.getRuntime().exec(new String[]{"ln","-s",target,linkname}, null);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HADOOP-8621) FileUtil.symLink fails if spaces in path

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13423037#comment-13423037 ] 

Hudson commented on HADOOP-8621:
--------------------------------

Integrated in Hadoop-Hdfs-trunk #1116 (See [https://builds.apache.org/job/Hadoop-Hdfs-trunk/1116/])
    Amend previous commit of HDFS-3626: accidentally included a hunk from HADOOP-8621 in svn commit. Reverting that hunk (Revision 1365817)

     Result = FAILURE
todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1365817
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java

                
> FileUtil.symLink fails if spaces in path
> ----------------------------------------
>
>                 Key: HADOOP-8621
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8621
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Robert Fuller
>            Priority: Minor
>         Attachments: hadoop-8621.txt, patch.txt
>
>
> the 'ln -s' command fails in the current implementation if there is a space in the path for the target or linkname. A small change resolves the issue.
> String cmd = "ln -s " + target + " " + linkname;
> //Process p = Runtime.getRuntime().exec(cmd, null); //broken
> Process p = Runtime.getRuntime().exec(new String[]{"ln","-s",target,linkname}, null);

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira