hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harsh J (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HADOOP-7974) TestViewFsTrash incorrectly determines the user's home directory
Date Sun, 15 Jan 2012 05:06:41 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-7974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Harsh J updated HADOOP-7974:

    Attachment: HADOOP-7974.patch

Patch that uses a get-parent call instead of hacking with strings.
> TestViewFsTrash incorrectly determines the user's home directory
> ----------------------------------------------------------------
>                 Key: HADOOP-7974
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7974
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: 0.23.1
>            Reporter: Eli Collins
>            Assignee: Harsh J
>         Attachments: HADOOP-7974.patch
> HADOOP-7284 added a test called TestViewFsTrash which contains the following code to
determine the user's home directory. It only works if the user's directory is one level deep,
and breaks if the home directory is more than one level deep (eg user hudson, who's home dir
might be /usr/lib/hudson instead of /home/hudson).
> {code}
>     // create a link for home directory so that trash path works
>     // set up viewfs's home dir root to point to home dir root on target
>     // But home dir is different on linux, mac etc.
>     // Figure it out by calling home dir on target
>    String homeDir = fsTarget.getHomeDirectory().toUri().getPath();
>    int indexOf2ndSlash = homeDir.indexOf('/', 1);
>    String homeDirRoot = homeDir.substring(0, indexOf2ndSlash);
>    ConfigUtil.addLink(conf, homeDirRoot,
>        fsTarget.makeQualified(new Path(homeDirRoot)).toUri()); 
>    ConfigUtil.setHomeDirConf(conf, homeDirRoot);
>    Log.info("Home dir base " + homeDirRoot);
> {code}
> Seems like we should instead search from the end of the path for the last slash and use
that as the base, ie ask the home directory for its parent.

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


View raw message