From 31aee4aa2aea54740f48bf2cc3bb9f8760c932c9 Mon Sep 17 00:00:00 2001 From: Alejandro Abdelnur Date: Fri, 6 Apr 2012 08:42:37 +0000 Subject: [PATCH] HADOOP-8086. KerberosName silently sets defaultRealm to empty if the Kerberos config is not found, it should log a WARN (tucu) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1310233 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop/security/authentication/util/KerberosName.java | 6 +++++- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosName.java b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosName.java index 6395867071..9564026937 100644 --- a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosName.java +++ b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/KerberosName.java @@ -23,10 +23,11 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -import java.lang.reflect.Method; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** @@ -38,6 +39,8 @@ @InterfaceAudience.LimitedPrivate({"HDFS", "MapReduce"}) @InterfaceStability.Evolving public class KerberosName { + private static final Logger LOG = LoggerFactory.getLogger(KerberosName.class); + /** The first component of the name */ private final String serviceName; /** The second component of the name. It may be null. */ @@ -81,6 +84,7 @@ public class KerberosName { try { defaultRealm = KerberosUtil.getDefaultRealm(); } catch (Exception ke) { + LOG.warn("Kerberos krb5 configuration not found, setting default realm to empty"); defaultRealm=""; } } diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index c51b413c3f..bfb3f653a3 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -255,6 +255,9 @@ Release 2.0.0 - UNRELEASED HADOOP-8077. HA: fencing method should be able to be configured on a per-NN or per-NS basis (todd) + HADOOP-8086. KerberosName silently sets defaultRealm to "" if the + Kerberos config is not found, it should log a WARN (tucu) + OPTIMIZATIONS BUG FIXES