You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by br...@apache.org on 2014/09/30 00:07:17 UTC
git commit: HADOOP-11130. NFS updateMaps OS check is reversed.
Contributed by Brandon Li
Repository: hadoop
Updated Branches:
refs/heads/trunk 64aef1896 -> c88c6c57a
HADOOP-11130. NFS updateMaps OS check is reversed. Contributed by Brandon Li
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/c88c6c57
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/c88c6c57
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/c88c6c57
Branch: refs/heads/trunk
Commit: c88c6c57aa79e8a1f33d2e075491656f472c858b
Parents: 64aef18
Author: Brandon Li <br...@apache.org>
Authored: Mon Sep 29 15:05:43 2014 -0700
Committer: Brandon Li <br...@apache.org>
Committed: Mon Sep 29 15:05:59 2014 -0700
----------------------------------------------------------------------
hadoop-common-project/hadoop-common/CHANGES.txt | 2 ++
.../java/org/apache/hadoop/nfs/nfs3/IdUserGroup.java | 15 +++++++--------
2 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/c88c6c57/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index ea1d8fd..9d0816f 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -763,6 +763,8 @@ Release 2.6.0 - UNRELEASED
HADOOP-1110. JavaKeystoreProvider should not report a key as created if it
was not flushed to the backing file.
+ HADOOP-11130. NFS updateMaps OS check is reversed (brandonli)
+
BREAKDOWN OF HDFS-6134 AND HADOOP-10150 SUBTASKS AND RELATED JIRAS
HADOOP-10734. Implement high-performance secure random number sources.
http://git-wip-us.apache.org/repos/asf/hadoop/blob/c88c6c57/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/IdUserGroup.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/IdUserGroup.java b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/IdUserGroup.java
index 1a7a3f4..0098b47 100644
--- a/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/IdUserGroup.java
+++ b/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/nfs3/IdUserGroup.java
@@ -45,8 +45,8 @@ public class IdUserGroup {
private final static String OS = System.getProperty("os.name");
/** 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 GET_ALL_USERS_CMD = "getent passwd | cut -d: -f1,3";
+ static final String 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";
@@ -223,16 +223,15 @@ public class IdUserGroup {
+ "' does not exist.");
}
- if (OS.startsWith("Linux")) {
- updateMapInternal(uMap, "user", LINUX_GET_ALL_USERS_CMD, ":",
+ if (OS.startsWith("Mac")) {
+ updateMapInternal(uMap, "user", MAC_GET_ALL_USERS_CMD, "\\s+",
staticMapping.uidMapping);
- updateMapInternal(gMap, "group", LINUX_GET_ALL_GROUPS_CMD, ":",
+ updateMapInternal(gMap, "group", MAC_GET_ALL_GROUPS_CMD, "\\s+",
staticMapping.gidMapping);
} else {
- // Mac
- updateMapInternal(uMap, "user", MAC_GET_ALL_USERS_CMD, "\\s+",
+ updateMapInternal(uMap, "user", GET_ALL_USERS_CMD, ":",
staticMapping.uidMapping);
- updateMapInternal(gMap, "group", MAC_GET_ALL_GROUPS_CMD, "\\s+",
+ updateMapInternal(gMap, "group", GET_ALL_GROUPS_CMD, ":",
staticMapping.gidMapping);
}