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:
parent
4f79b07e17
commit
5c8d9aecf7
|
@ -223,6 +223,9 @@ Trunk (unreleased changes)
|
|||
HADOOP-6932. Namenode start (init) fails because of invalid kerberos
|
||||
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
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -209,10 +209,25 @@ public class UserGroupInformation {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the configuration values for UGI.
|
||||
* Initialize UGI and related classes.
|
||||
* @param conf the configuration to use
|
||||
*/
|
||||
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);
|
||||
if (value == null || "simple".equals(value)) {
|
||||
useKerberos = false;
|
||||
|
@ -233,13 +248,6 @@ public class UserGroupInformation {
|
|||
javax.security.auth.login.Configuration.setConfiguration
|
||||
(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;
|
||||
UserGroupInformation.conf = conf;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue