HADOOP-15294. TestUGILoginFromKeytab fails on Java9
Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
This commit is contained in:
parent
e6de10d0a6
commit
fea16a440d
@ -1885,10 +1885,13 @@ public void login() throws LoginException {
|
|||||||
@Override
|
@Override
|
||||||
public void logout() throws LoginException {
|
public void logout() throws LoginException {
|
||||||
synchronized(getSubjectLock()) {
|
synchronized(getSubjectLock()) {
|
||||||
|
if (this.getSubject() != null
|
||||||
|
&& !this.getSubject().getPrivateCredentials().isEmpty()) {
|
||||||
super.logout();
|
super.logout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A JAAS configuration that defines the login modules that we want
|
* A JAAS configuration that defines the login modules that we want
|
||||||
|
@ -166,7 +166,7 @@ public void testKerberosLogin() throws Exception {
|
|||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
if (loginContext != null && loginContext.getSubject() != null
|
if (loginContext != null && loginContext.getSubject() != null
|
||||||
&& !loginContext.getSubject().getPrincipals().isEmpty()) {
|
&& !loginContext.getSubject().getPrivateCredentials().isEmpty()) {
|
||||||
loginContext.logout();
|
loginContext.logout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user