HADOOP-15764. Addendum patch: Fix NPE in SecurityUtil.
This commit is contained in:
parent
2a5d4315bf
commit
5c8d90763c
@ -586,12 +586,14 @@ public InetAddress getByName(String host) throws UnknownHostException {
|
|||||||
* hadoop.security.token.service.use_ip=false
|
* hadoop.security.token.service.use_ip=false
|
||||||
*/
|
*/
|
||||||
protected static class QualifiedHostResolver implements HostResolver {
|
protected static class QualifiedHostResolver implements HostResolver {
|
||||||
private List<String> searchDomains;
|
private List<String> searchDomains = new ArrayList<>();
|
||||||
{
|
{
|
||||||
ResolverConfig resolverConfig = ResolverConfig.getCurrentConfig();
|
ResolverConfig resolverConfig = ResolverConfig.getCurrentConfig();
|
||||||
searchDomains = new ArrayList<>();
|
Name[] names = resolverConfig.searchPath();
|
||||||
for (Name name : resolverConfig.searchPath()) {
|
if (names != null) {
|
||||||
searchDomains.add(name.toString());
|
for (Name name : names) {
|
||||||
|
searchDomains.add(name.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user