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 "Allen Wittenauer (JIRA)" <ji...@apache.org> on 2014/09/25 06:09:34 UTC

[jira] [Commented] (HADOOP-11130) NFS updateMaps OS check is reversed

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

Allen Wittenauer commented on HADOOP-11130:
-------------------------------------------

The code looks like this:

{code}
  /** Shell commands to get users and groups */
  static final String LINUX_GET_ALL_USERS_CMD = "getent passwd | cut -d: -f1,3";
  static final String LINUX_GET_ALL_GROUPS_CMD = "getent group | cut -d: -f1,3";
  static final String MAC_GET_ALL_USERS_CMD = "dscl . -list /Users UniqueID";
  static final String MAC_GET_ALL_GROUPS_CMD = "dscl . -list /Groups PrimaryGroupID";
...
    if (OS.startsWith("Linux")) {
      updateMapInternal(uMap, "user", LINUX_GET_ALL_USERS_CMD, ":",
          staticMapping.uidMapping);
      updateMapInternal(gMap, "group", LINUX_GET_ALL_GROUPS_CMD, ":",
          staticMapping.gidMapping);
    } else {
      // Mac
      updateMapInternal(uMap, "user", MAC_GET_ALL_USERS_CMD, "\\s+",
          staticMapping.uidMapping);
      updateMapInternal(gMap, "group", MAC_GET_ALL_GROUPS_CMD, "\\s+",
          staticMapping.gidMapping);
    }
{code}

dscl is *only* supported on OS X. getent is supported on Linux, Solaris, FreeBSD, ... Ideally, 'LINUX_GET_ALL_USERS_CMD' would get renamed to something less Linux specific, we'd check to see if the OS is Mac, etc. to be much more compatible with other OSes.

> NFS updateMaps OS check is reversed
> -----------------------------------
>
>                 Key: HADOOP-11130
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11130
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Allen Wittenauer
>
> getent is fairly standard, dscl is not.  Yet the code logic prefers dscl for non-Linux platforms. This code should for OS X and use dscl and, if not, then use getent.  See comments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)