HADOOP-6913. Circular initialization between UserGroupInformation and KerberosName

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@991038 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Boris Shkolnik 2010-08-31 00:10:05 +00:00
parent 4f79b07e17
commit 5c8d9aecf7
2 changed files with 19 additions and 8 deletions

View File

@ -223,6 +223,9 @@ Trunk (unreleased changes)
HADOOP-6932. Namenode start (init) fails because of invalid kerberos HADOOP-6932. Namenode start (init) fails because of invalid kerberos
key, even when security set to "simple" (boryas) key, even when security set to "simple" (boryas)
HADOOP-6913. Circular initialization between UserGroupInformation and
KerberosName (Kan Zhang via boryas)
Release 0.21.0 - Unreleased Release 0.21.0 - Unreleased
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -209,10 +209,25 @@ private static synchronized void ensureInitialized() {
} }
/** /**
* Set the configuration values for UGI. * Initialize UGI and related classes.
* @param conf the configuration to use * @param conf the configuration to use
*/ */
private static synchronized void initialize(Configuration conf) { private static synchronized void initialize(Configuration conf) {
initUGI(conf);
// give the configuration on how to translate Kerberos names
try {
KerberosName.setConfiguration(conf);
} catch (IOException ioe) {
throw new RuntimeException("Problem with Kerberos auth_to_local name " +
"configuration", ioe);
}
}
/**
* Set the configuration values for UGI.
* @param conf the configuration to use
*/
private static synchronized void initUGI(Configuration conf) {
String value = conf.get(HADOOP_SECURITY_AUTHENTICATION); String value = conf.get(HADOOP_SECURITY_AUTHENTICATION);
if (value == null || "simple".equals(value)) { if (value == null || "simple".equals(value)) {
useKerberos = false; useKerberos = false;
@ -233,13 +248,6 @@ private static synchronized void initialize(Configuration conf) {
javax.security.auth.login.Configuration.setConfiguration javax.security.auth.login.Configuration.setConfiguration
(new HadoopConfiguration()); (new HadoopConfiguration());
// give the configuration on how to translate Kerberos names
try {
KerberosName.setConfiguration(conf);
} catch (IOException ioe) {
throw new RuntimeException("Problem with Kerberos auth_to_local name " +
"configuration", ioe);
}
isInitialized = true; isInitialized = true;
UserGroupInformation.conf = conf; UserGroupInformation.conf = conf;
} }