-
Bug
-
Resolution: Incomplete
-
P4
-
None
-
24.0.2
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
Both of these cases will return false.
The first one, blabla, will return true in version 17.0.14 but return false in newer versions such as 24.0.2.
The second case returns false in all versions.
The first test case is derived from the JDK test case test/jdk/java/net/SocketPermission/Wildcard.java, so it is unreasonable for this test case to fail in the latest version.
The second test is similar to the first one, but within ports.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
test pass
ACTUAL -
Failed: ("java.net.SocketPermission" "*.blabla.bla" "connect,listen,accept,resolve") does not imply ("java.net.SocketPermission" "bla.blabla.bla" "connect,listen,accept,resolve")
Failed: ("java.net.SocketPermission" "*.test.com:1024-2048" "connect,resolve") does not imply ("java.net.SocketPermission" "host.test.com:1024" "connect,resolve")
---------- BEGIN SOURCE ----------
import java.net.SocketPermission;
public class Wildcard
{
public static void main(String[] args) throws Exception {
SocketPermission star_All =
new SocketPermission("*.blabla.bla", "listen,accept,connect");
SocketPermission www_All =
new SocketPermission("bla.blabla.bla", "listen,accept,connect");
if (!star_All.implies(www_All)) {
System.out.println(
"Failed: " + star_All + " does not imply " + www_All);
}
SocketPermission wildcardWithPort = new SocketPermission("*.test.com:1024-2048", "connect");
SocketPermission validPort = new SocketPermission("host.test.com:1024", "connect");
if (!wildcardWithPort.implies(validPort)) {
System.out.println("Failed: " + wildcardWithPort + " does not imply " + validPort);
}
}
}
---------- END SOURCE ----------
Both of these cases will return false.
The first one, blabla, will return true in version 17.0.14 but return false in newer versions such as 24.0.2.
The second case returns false in all versions.
The first test case is derived from the JDK test case test/jdk/java/net/SocketPermission/Wildcard.java, so it is unreasonable for this test case to fail in the latest version.
The second test is similar to the first one, but within ports.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
test pass
ACTUAL -
Failed: ("java.net.SocketPermission" "*.blabla.bla" "connect,listen,accept,resolve") does not imply ("java.net.SocketPermission" "bla.blabla.bla" "connect,listen,accept,resolve")
Failed: ("java.net.SocketPermission" "*.test.com:1024-2048" "connect,resolve") does not imply ("java.net.SocketPermission" "host.test.com:1024" "connect,resolve")
---------- BEGIN SOURCE ----------
import java.net.SocketPermission;
public class Wildcard
{
public static void main(String[] args) throws Exception {
SocketPermission star_All =
new SocketPermission("*.blabla.bla", "listen,accept,connect");
SocketPermission www_All =
new SocketPermission("bla.blabla.bla", "listen,accept,connect");
if (!star_All.implies(www_All)) {
System.out.println(
"Failed: " + star_All + " does not imply " + www_All);
}
SocketPermission wildcardWithPort = new SocketPermission("*.test.com:1024-2048", "connect");
SocketPermission validPort = new SocketPermission("host.test.com:1024", "connect");
if (!wildcardWithPort.implies(validPort)) {
System.out.println("Failed: " + wildcardWithPort + " does not imply " + validPort);
}
}
}
---------- END SOURCE ----------