hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen Wittenauer (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HDFS-506) Incorrect UserName at Solaris because it has no "whoami" command by default
Date Fri, 18 Sep 2009 16:46:16 GMT

    [ https://issues.apache.org/jira/browse/HDFS-506?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757254#action_12757254

Allen Wittenauer commented on HDFS-506:

The only versions that don't have /usr/ucb/whoami are Solaris 1.x aka SunOS 4.x.  Perhaps
a bit of (rough) history will help explain:

When the transition from BSD (Solaris 1.x) to SysV (Solaris 2.x) was made, there was a need
to provide some backward compatibility.  Given that whoami is BSD in origin, it was moved
to /usr/ucb with the rest of the BSD-specific commands.  [This is why /usr/bin/ps -ef (SysV)
and /usr/ucb/ps auwwx (BSD) work the way they do).  In addition, commands that had different
semantics between SysV and POSIX were also shifted around.  So if you want POSIX-style semantics
for something like id, you need to use /usr/xpg4/bin/id or /usr/xpg6/bin/id .

The reality is, is that if we're going to keep this inane fork()'ing for the user and group
information, the patch that uses id (and /usr/xpg4/bin/id on Solaris) is probably a better
fix simply because it is easy to point to a spec that says "these command line options will
provide this information".  whoami, being BSD, has little-to-no such spec and is standard
by defacto... but only BSD and systems that want to be compatible with it.  [Linux being a
kitchen sink sort of OS falls into the latter.]

That said, the only machines where /usr/ucb/whoami won't exist are those machines that don't
install the BSD backward compat packages.  Thus my comment on 'hardened' machines up above.

> Incorrect UserName at Solaris because it has no "whoami" command by default
> ---------------------------------------------------------------------------
>                 Key: HDFS-506
>                 URL: https://issues.apache.org/jira/browse/HDFS-506
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: documentation
>    Affects Versions: 0.20.1
>         Environment: OS: SunOS 5.10
>            Reporter: Urko Benito
>         Attachments: PermissionChecker.java.diff, Shell.java.diff, test-hadoop-security.tar.gz,
>   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

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

View raw message