From 5b3e74e42cbb24a47842f18968ac7ca17886c436 Mon Sep 17 00:00:00 2001 From: Alejandro Abdelnur Date: Fri, 19 Jul 2013 19:01:18 +0000 Subject: [PATCH] ADOOP-9643. org.apache.hadoop.security.SecurityUtil calls toUpperCase(Locale.getDefault()) as well as toLowerCase(Locale.getDefault()) on hadoop.security.authentication value. (markrmiller@gmail.com via tucu) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1504965 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 4 ++++ .../main/java/org/apache/hadoop/security/SecurityUtil.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 4136e40acf..a389b1b0b0 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -830,6 +830,10 @@ Release 2.1.0-beta - 2013-07-02 HADOOP-8440. HarFileSystem.decodeHarURI fails for URIs whose host contains numbers. (Ivan Mitic via cnauroth) + HADOOP-9643. org.apache.hadoop.security.SecurityUtil calls + toUpperCase(Locale.getDefault()) as well as toLowerCase(Locale.getDefault()) + on hadoop.security.authentication value. (markrmiller@gmail.com via tucu) + Release 2.0.5-alpha - 06/06/2013 INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java index b6bd06af39..416a442f12 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java @@ -672,7 +672,7 @@ public class SecurityUtil { public static AuthenticationMethod getAuthenticationMethod(Configuration conf) { String value = conf.get(HADOOP_SECURITY_AUTHENTICATION, "simple"); try { - return Enum.valueOf(AuthenticationMethod.class, value.toUpperCase()); + return Enum.valueOf(AuthenticationMethod.class, value.toUpperCase(Locale.ENGLISH)); } catch (IllegalArgumentException iae) { throw new IllegalArgumentException("Invalid attribute value for " + HADOOP_SECURITY_AUTHENTICATION + " of " + value); @@ -685,6 +685,6 @@ public class SecurityUtil { authenticationMethod = AuthenticationMethod.SIMPLE; } conf.set(HADOOP_SECURITY_AUTHENTICATION, - authenticationMethod.toString().toLowerCase()); + authenticationMethod.toString().toLowerCase(Locale.ENGLISH)); } }