RFR: JDK-8134577 - Eliminate or standardize a replacement for sun.net.spi.nameservice.NameServiceDescriptor

Mark Sheppard mark.sheppard at oracle.com
Thu Dec 31 14:30:05 UTC 2015


Hi
   please oblige and review the current version of the fix  for
https://bugs.openjdk.java.net/browse/JDK-8134577

at
http://cr.openjdk.java.net/~msheppar/8134577/webrev.05/

which is  based on feedback from the second review.

In summary the following changes have been made

* hosts file mapping structure has been changed to align with 
/etc/hosts, that is, <ip address>  <host alias list> rather than  
<hostname>  <ip address>

* elementary comment handling added, skip lines starting with #

* lookupAllHostAddr returns an array of InetAddresses, rather than a 
single element array containing the first host address mapping

* the illegal_state_exception  token handling has been removed, and a 
corresponding test deadlock/Hang.java removed

* transient key word added to member variables useLocalHostsFileLookup 
and hostsFileName

* added an explicit test to exercise the internal NameService

regards
Mark

On 13/11/2015 12:44, Mark Sheppard wrote:
> Hi,
>    to summarize the amendments below:
>
> ServiceConfigurationError removed - the code no longer reads the 
> nameservice provider property, it silently ignored
>
> try-with-resources statement added in getHostByAddr and 
> lookupAllHostAddr methods of NameService, and duplicate statements removed
>
> hosts file name in tests changed to TestHosts to avoid any potential 
> confusion with /etc/hosts
>
> regards
> Mark
>
>
>
> On 12/11/2015 16:46, Mark Sheppard wrote:
>> Hi,
>>     based on feedback from first review the updates have been amended
>> please oblige and review the current set of changes as per
>>
>> http://cr.openjdk.java.net/~msheppar/8134577/webrev.02/
>>
>> regards
>> Mark
>>
>> On 25/10/2015 23:32, Mark Sheppard wrote:
>>> Hi,
>>>    please oblige and review the following changes
>>> http://cr.openjdk.java.net/~msheppar/8134577/webrev/
>>>
>>> which address the issue raised in
>>> https://bugs.openjdk.java.net/browse/JDK-8134577
>>>
>>> the operative word has been "eliminate".
>>> As such, the interface and service descriptor 
>>> sun.net.spi.nameservice.NameService
>>> sun.net.spi.nameservice.NameServiceDescriptor*
>>> *together with its implementation 
>>> (sun.net.nameservice.dns.DNSNameService)
>>> has been remove from the JDK libraries.
>>>
>>> The immediate impact is seen in the JDK testing framework.
>>>
>>> To facilitate testing activity, and provide a replacement for the 
>>> customized NameService implementations in the
>>> JDK tests,  the default NameService has been extended to support
>>> the retrieval of host to IP address mappings from a file.
>>> The file path is specified with a system property " jdk.internal.hosts".
>>>
>>> Previously a nameservice provider was specified by setting the 
>>> system property
>>> "sun.net.spi.nameservice.provider.", as per the documentation
>>> http://docs.oracle.com/javase/8/docs/technotes/guides/net/properties.html
>>>
>>> InetAddress now tests to determine if this property is set and will 
>>> throw a ServiceConfigurationError
>>> indicating that this functionality is no longer supported. The 
>>> choice of ServideConfigurationError may cause
>>> some debate, or disagreement. The rationale was that InternalError,  
>>> is documented to relate to a JVM error,
>>> and javax.naming.NamingException has a context of DirContext.
>>> A possible alternative candidate could be 
>>> javax.naming.ServiceUnavailableException.
>>> As such, the setting of the property 
>>> "sun.net.spi.nameservice.provider." was used, previously, as a 
>>> configuration
>>> parameter for the loading of a NamerService service provider, and as 
>>> this is now (considered) an error, ServiceConfigurationError,
>>> seemed a best fit!
>>>
>>> These changes impacted a number of jdk security tests, also. The 
>>> affected tetsts have been amended to adopt the
>>> changes, with the exception of 
>>> test/sun/security/x509/URICertStore/ExtensionsWithLDAP.java
>>> which will require some rewrite.
>>>
>>> regards
>>> Mark
>>>
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/security-dev/attachments/20151231/b033d926/attachment.html>


More information about the security-dev mailing list