diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 8cdf3264061..fd0d92df215 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -105,6 +105,9 @@ Release 2.0.3-alpha - Unreleased BUG FIXES + HADOOP-8418. Update UGI Principal classes name for running with + IBM JDK on 64 bits Windows. (Yu Gao via eyang) + HADOOP-8795. BASH tab completion doesn't look in PATH, assumes path to executable is specified. (Sean Mackrory via atm) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java index bfce807e32c..4e3cfab9865 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java @@ -288,13 +288,17 @@ public class UserGroupInformation { private static String OS_LOGIN_MODULE_NAME; private static Class OS_PRINCIPAL_CLASS; - private static final boolean windows = - System.getProperty("os.name").startsWith("Windows"); + private static final boolean windows = + System.getProperty("os.name").startsWith("Windows"); + private static final boolean is64Bit = + System.getProperty("os.arch").contains("64"); /* Return the OS login module class name */ private static String getOSLoginModuleName() { if (System.getProperty("java.vendor").contains("IBM")) { - return windows ? "com.ibm.security.auth.module.NTLoginModule" - : "com.ibm.security.auth.module.LinuxLoginModule"; + return windows ? (is64Bit + ? "com.ibm.security.auth.module.Win64LoginModule" + : "com.ibm.security.auth.module.NTLoginModule") + : "com.ibm.security.auth.module.LinuxLoginModule"; } else { return windows ? "com.sun.security.auth.module.NTLoginModule" : "com.sun.security.auth.module.UnixLoginModule"; @@ -308,13 +312,13 @@ public class UserGroupInformation { try { if (System.getProperty("java.vendor").contains("IBM")) { if (windows) { - return (Class) - cl.loadClass("com.ibm.security.auth.UsernamePrincipal"); + return (Class) (is64Bit + ? cl.loadClass("com.ibm.security.auth.UsernamePrincipal") + : cl.loadClass("com.ibm.security.auth.NTUserPrincipal")); } else { - return (Class) - (System.getProperty("os.arch").contains("64") - ? cl.loadClass("com.ibm.security.auth.UsernamePrincipal") - : cl.loadClass("com.ibm.security.auth.LinuxPrincipal")); + return (Class) (is64Bit + ? cl.loadClass("com.ibm.security.auth.UsernamePrincipal") + : cl.loadClass("com.ibm.security.auth.LinuxPrincipal")); } } else { return (Class) (windows