HADOOP-7982. UserGroupInformation fails to login if thread's context classloader can't load HadoopLoginModule. Contributed by Todd Lipcon.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1233751 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6861560098
commit
b7eb5334f5
@ -279,6 +279,9 @@ Release 0.23.1 - Unreleased
|
|||||||
HADOOP-7971. Adding back job/pipes/queue commands to bin/hadoop for
|
HADOOP-7971. Adding back job/pipes/queue commands to bin/hadoop for
|
||||||
backward compatibility. (Prashath Sharma via acmurthy)
|
backward compatibility. (Prashath Sharma via acmurthy)
|
||||||
|
|
||||||
|
HADOOP-7982. UserGroupInformation fails to login if thread's context
|
||||||
|
classloader can't load HadoopLoginModule. (todd)
|
||||||
|
|
||||||
Release 0.23.0 - 2011-11-01
|
Release 0.23.0 - 2011-11-01
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -416,7 +416,17 @@ public AppConfigurationEntry[] getAppConfigurationEntry(String appName) {
|
|||||||
|
|
||||||
private static LoginContext
|
private static LoginContext
|
||||||
newLoginContext(String appName, Subject subject) throws LoginException {
|
newLoginContext(String appName, Subject subject) throws LoginException {
|
||||||
|
// Temporarily switch the thread's ContextClassLoader to match this
|
||||||
|
// class's classloader, so that we can properly load HadoopLoginModule
|
||||||
|
// from the JAAS libraries.
|
||||||
|
Thread t = Thread.currentThread();
|
||||||
|
ClassLoader oldCCL = t.getContextClassLoader();
|
||||||
|
t.setContextClassLoader(HadoopLoginModule.class.getClassLoader());
|
||||||
|
try {
|
||||||
return new LoginContext(appName, subject, null, new HadoopConfiguration());
|
return new LoginContext(appName, subject, null, new HadoopConfiguration());
|
||||||
|
} finally {
|
||||||
|
t.setContextClassLoader(oldCCL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private LoginContext getLogin() {
|
private LoginContext getLogin() {
|
||||||
|
Loading…
Reference in New Issue
Block a user