hadoop-common-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] (HADOOP-11130) NFS updateMaps OS check is reversed
Date Thu, 25 Sep 2014 04:09:34 GMT

    [ 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)

Mime
View raw message