Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
HADOOP-8418. Update UGI Principal classes name for running with
Browse files Browse the repository at this point in the history
IBM JDK on 64 bits Windows.  (Yu Gao via eyang)


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1418572 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
macroadster committed Dec 8, 2012
1 parent 0fb5df0 commit c28b0c5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
3 changes: 3 additions & 0 deletions hadoop-common-project/hadoop-common/CHANGES.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ Trunk (Unreleased)


BUG FIXES BUG FIXES


HADOOP-8418. Update UGI Principal classes name for running with
IBM JDK on 64 bits Windows. (Yu Gao via eyang)

HADOOP-8177. MBeans shouldn't try to register when it fails to create MBeanName. HADOOP-8177. MBeans shouldn't try to register when it fails to create MBeanName.
(Devaraj K via umamahesh) (Devaraj K via umamahesh)


Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -299,13 +299,17 @@ private static boolean isAuthenticationMethodEnabled(AuthenticationMethod method


private static String OS_LOGIN_MODULE_NAME; private static String OS_LOGIN_MODULE_NAME;
private static Class<? extends Principal> OS_PRINCIPAL_CLASS; private static Class<? extends Principal> OS_PRINCIPAL_CLASS;
private static final boolean windows = private static final boolean windows =
System.getProperty("os.name").startsWith("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 */ /* Return the OS login module class name */
private static String getOSLoginModuleName() { private static String getOSLoginModuleName() {
if (System.getProperty("java.vendor").contains("IBM")) { if (System.getProperty("java.vendor").contains("IBM")) {
return windows ? "com.ibm.security.auth.module.NTLoginModule" return windows ? (is64Bit
: "com.ibm.security.auth.module.LinuxLoginModule"; ? "com.ibm.security.auth.module.Win64LoginModule"
: "com.ibm.security.auth.module.NTLoginModule")
: "com.ibm.security.auth.module.LinuxLoginModule";
} else { } else {
return windows ? "com.sun.security.auth.module.NTLoginModule" return windows ? "com.sun.security.auth.module.NTLoginModule"
: "com.sun.security.auth.module.UnixLoginModule"; : "com.sun.security.auth.module.UnixLoginModule";
Expand All @@ -319,13 +323,13 @@ private static Class<? extends Principal> getOsPrincipalClass() {
try { try {
if (System.getProperty("java.vendor").contains("IBM")) { if (System.getProperty("java.vendor").contains("IBM")) {
if (windows) { if (windows) {
return (Class<? extends Principal>) return (Class<? extends Principal>) (is64Bit
cl.loadClass("com.ibm.security.auth.UsernamePrincipal"); ? cl.loadClass("com.ibm.security.auth.UsernamePrincipal")
: cl.loadClass("com.ibm.security.auth.NTUserPrincipal"));
} else { } else {
return (Class<? extends Principal>) return (Class<? extends Principal>) (is64Bit
(System.getProperty("os.arch").contains("64") ? cl.loadClass("com.ibm.security.auth.UsernamePrincipal")
? cl.loadClass("com.ibm.security.auth.UsernamePrincipal") : cl.loadClass("com.ibm.security.auth.LinuxPrincipal"));
: cl.loadClass("com.ibm.security.auth.LinuxPrincipal"));
} }
} else { } else {
return (Class<? extends Principal>) (windows return (Class<? extends Principal>) (windows
Expand Down

0 comments on commit c28b0c5

Please sign in to comment.