[ 
https://issues.apache.org/jira/browse/HADOOP-20020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Siyao Meng updated HADOOP-20020:
--------------------------------
    Fix Version/s: 3.5.1

> DNS.reverseDns throws NullPointerException when the answer has no PTR record
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-20020
>                 URL: https://issues.apache.org/jira/browse/HADOOP-20020
>             Project: Hadoop Common
>          Issue Type: Sub-task
>            Reporter: Siyao Meng
>            Assignee: Siyao Meng
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.4.4, 3.5.1, 3.6.0
>
>
> {{DNS.reverseDns}} reads {{attribute.get("PTR").get()}} without a null check. 
> When the DNS server answers the reverse query with NOERROR but no PTR record 
> (a NODATA answer), JNDI returns no PTR attribute and {{reverseDns}} throws 
> {{NullPointerException}}.
> The callers, {{DNS.getHosts}} and {{DNSDomainNameResolver.getHostnameByIP}}, 
> only catch {{NamingException}}, so the exception escapes instead of falling 
> back. Through {{getHostnameByIP}} it reaches 
> {{SecurityUtil.getServerPrincipal(String, InetAddress)}} and 
> {{ServiceAuthorizationManager.authorize}}. A name that does not exist 
> (NXDOMAIN) already fails with {{NameNotFoundException}} and is handled.
> Throw {{NameNotFoundException}} when the answer has no PTR record. This 
> applies to IPv4 and IPv6 addresses alike. It was seen with a resolver that 
> answers NODATA for the {{ip6.arpa}} name of {{::}}.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to