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 "Urko Benito (JIRA)" <ji...@apache.org> on 2009/09/20 11:33:16 UTC

[jira] Commented: (HADOOP-6272) Incorrect UserName at Solaris because it has no "whoami" command by default

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

Urko Benito commented on HADOOP-6272:
-------------------------------------

I think there are some questions.

# The _whoami without full path_. As *Allen* says, the Solaris default installation comes with _BSD Style Commands_ like whoami, id, etc. The questions is that Solaris is a SysV and if you put BSD style commands before SysV commands may be the system will be break. At the moment _Solaris will be retro-compatible_ and will install the BSD Compatible Files by default, but if the user says _not_ to install it will no be any BSD like commands on the Solaris box.

#  The _Solaris specific code_, i think, yes it's a problem because we need to maintance but there's no option. For the _whoami_ command we can use Java builtin function, but not for _group_

{code:java}
System.getProperty("user.name");
{code}

As a simple note, yes, you can _hack_ the _System.getProperty_ with a _System.setProperty_ 


# I subimited the _diff_ to show how it can be solved, _it was not a patch_  i'd create a patch but there was no agreement to create/commit the patch because it was Os specific, so i didn't do it.

I will create a HADOOP-6272 patch file with the changes, on tomorroy with JUnit test and so




> Incorrect UserName at Solaris because it has no "whoami" command by default
> ---------------------------------------------------------------------------
>
>                 Key: HADOOP-6272
>                 URL: https://issues.apache.org/jira/browse/HADOOP-6272
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: security, util
>    Affects Versions: 0.20.1, 0.21.0
>         Environment: OS: SunOS 5.10
>            Reporter: Urko Benito
>         Attachments: PermissionChecker.java.diff, Shell.java.diff, test-hadoop-security.tar.gz, UnixUserGroupInformation.java.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Solaris enviroment has no __whoami__ command, so the __getUnixUserName()__ at UnixUserGroupInformation class fails because it's calling to Shell.USER_NAME_COMMAND which is defines as "whoami".
> So it launched an Exception and set the default "DrWho" username ignoring all the FileSystem permissions.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.