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 "sam rash (JIRA)" <ji...@apache.org> on 2010/05/18 17:27:46 UTC
[jira] Commented: (HADOOP-6770) chang UnixUserGroupInformation to
use "user.name" instead of whoami
[ https://issues.apache.org/jira/browse/HADOOP-6770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12868683#action_12868683 ]
sam rash commented on HADOOP-6770:
----------------------------------
we change:
{code}
static String getUnixUserName() throws IOException {
String[] result = executeShellCommand(
new String[]{Shell.USER_NAME_COMMAND});
if (result.length!=1) {
throw new IOException("Expect one token as the result of " +
Shell.USER_NAME_COMMAND + ": " + toString(result));
}
return result[0];
}
{code}
to
{code}
static String getUnixUserName() {
return System.getProperty("user.name");
}
{code}
we could check if "user.name" is null and fall back to whoami
> chang UnixUserGroupInformation to use "user.name" instead of whoami
> -------------------------------------------------------------------
>
> Key: HADOOP-6770
> URL: https://issues.apache.org/jira/browse/HADOOP-6770
> Project: Hadoop Common
> Issue Type: Improvement
> Affects Versions: 0.20.1
> Reporter: sam rash
>
> at present, we fork and use whoami to get the current username. we can avoid the fork(which can be slow) and user System.getProperty("user.name") which is set by the jvm
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.