HADOOP-11130. NFS updateMaps OS check is reversed. Contributed by Brandon Li
(cherry picked from commit c88c6c57aa
)
This commit is contained in:
parent
758fb8465a
commit
aa3d6d374d
|
@ -425,6 +425,8 @@ Release 2.6.0 - UNRELEASED
|
||||||
HADOOP-1110. JavaKeystoreProvider should not report a key as created if it
|
HADOOP-1110. JavaKeystoreProvider should not report a key as created if it
|
||||||
was not flushed to the backing file.
|
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
|
BREAKDOWN OF HDFS-6134 AND HADOOP-10150 SUBTASKS AND RELATED JIRAS
|
||||||
|
|
||||||
HADOOP-10734. Implement high-performance secure random number sources.
|
HADOOP-10734. Implement high-performance secure random number sources.
|
||||||
|
|
|
@ -45,8 +45,8 @@ public class IdUserGroup {
|
||||||
private final static String OS = System.getProperty("os.name");
|
private final static String OS = System.getProperty("os.name");
|
||||||
|
|
||||||
/** Shell commands to get users and groups */
|
/** Shell commands to get users and groups */
|
||||||
static final String LINUX_GET_ALL_USERS_CMD = "getent passwd | cut -d: -f1,3";
|
static final String 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_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_USERS_CMD = "dscl . -list /Users UniqueID";
|
||||||
static final String MAC_GET_ALL_GROUPS_CMD = "dscl . -list /Groups PrimaryGroupID";
|
static final String MAC_GET_ALL_GROUPS_CMD = "dscl . -list /Groups PrimaryGroupID";
|
||||||
|
|
||||||
|
@ -223,17 +223,16 @@ public class IdUserGroup {
|
||||||
+ "' does not exist.");
|
+ "' does not exist.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OS.startsWith("Linux")) {
|
if (OS.startsWith("Mac")) {
|
||||||
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+",
|
updateMapInternal(uMap, "user", MAC_GET_ALL_USERS_CMD, "\\s+",
|
||||||
staticMapping.uidMapping);
|
staticMapping.uidMapping);
|
||||||
updateMapInternal(gMap, "group", MAC_GET_ALL_GROUPS_CMD, "\\s+",
|
updateMapInternal(gMap, "group", MAC_GET_ALL_GROUPS_CMD, "\\s+",
|
||||||
staticMapping.gidMapping);
|
staticMapping.gidMapping);
|
||||||
|
} else {
|
||||||
|
updateMapInternal(uMap, "user", GET_ALL_USERS_CMD, ":",
|
||||||
|
staticMapping.uidMapping);
|
||||||
|
updateMapInternal(gMap, "group", GET_ALL_GROUPS_CMD, ":",
|
||||||
|
staticMapping.gidMapping);
|
||||||
}
|
}
|
||||||
|
|
||||||
uidNameMap = uMap;
|
uidNameMap = uMap;
|
||||||
|
|
Loading…
Reference in New Issue