RFR: JDK-8243376: java.net.SocketPermission.implies(Permission p) spec is mismatching with implementation [v9]
Pushkar N Kulkarni
duke at openjdk.java.net
Mon Jan 10 09:59:36 UTC 2022
On Wed, 10 Mar 2021 17:32:30 GMT, Jayashree S Kumar <duke at openjdk.java.net> wrote:
>> Issue
>>
>> https://bugs.openjdk.java.net/browse/JDK-8243376
>>
>> Problem
>>
>> The scenario is:
>> - Some specified target hostname resolves to two IP addresses (always the same address pair).
>> - The DNS resolved order of the two ip addresses changes (a usual LoadBalancer type behavior).
>> - The CNAME of the two ip addresses differ.
>>
>> In SocketPermission class(void getIP() method), it internally resolves and saves only the first IP address resolved, not all the IP addresses resolved.
>> - Depending on when the implier/implied SocketPermission hostname is resolved, the resolved addresses order differs, and the internally saved IP address mismatches, resulting on SocketPermission#implies() false.
>>
>>
>> Michael McMahon kindly reviewed and suggested changes: https://mail.openjdk.java.net/pipermail/net-dev/2020-May/014001.html
>
> Jayashree S Kumar has updated the pull request incrementally with one additional commit since the last revision:
>
> Jcheck Review: Corrected the tab error
src/java.base/share/classes/java/net/SocketPermission.java line 1002:
> 1000: that.getCanonName();
> 1001: }
> 1002: return this.cnames[0].equalsIgnoreCase(that.cnames[0]);
@jaysk1 On the event of us reaching here, won't `this` and `that` have multiple canonical names each, in different orders? Do you think we need to compare the arrays here?
-------------
PR: https://git.openjdk.java.net/jdk/pull/1916
More information about the net-dev
mailing list