8166359: java/net/URLPermission/nstest/lookup.sh fails if proxy is set since fix for JDK-8161016
Reviewed-by: chegar
This commit is contained in:
parent
3e5ef4867f
commit
0d0e86808b
@ -37,6 +37,7 @@ public class LookupTest {
|
||||
String url, boolean throwsSecException, boolean throwsIOException)
|
||||
{
|
||||
try {
|
||||
ProxySelector.setDefault(null);
|
||||
URL u = new URL(url);
|
||||
System.err.println ("Connecting to " + u);
|
||||
URLConnection urlc = u.openConnection();
|
||||
@ -71,7 +72,7 @@ public class LookupTest {
|
||||
System.out.print(port);
|
||||
} else if (cmd.equals("-runtest")) {
|
||||
port = Integer.parseInt(args[1]);
|
||||
String hostsFileName = System.getProperty("test.src", ".") + "/LookupTestHosts";
|
||||
String hostsFileName = System.getProperty("user.dir", ".") + "/LookupTestHosts";
|
||||
System.setProperty("jdk.net.hosts.file", hostsFileName);
|
||||
addMappingToHostsFile("allowedAndFound.com", "127.0.0.1", hostsFileName, false);
|
||||
addMappingToHostsFile("notAllowedButFound.com", "99.99.99.99", hostsFileName, true);
|
||||
|
@ -1,2 +0,0 @@
|
||||
127.0.0.1 allowedAndFound.com
|
||||
99.99.99.99 notAllowedButFound.com
|
@ -48,6 +48,7 @@ cat << POLICY > policy
|
||||
grant {
|
||||
permission java.net.URLPermission "http://allowedAndFound.com:${port}/-", "*:*";
|
||||
permission java.net.URLPermission "http://allowedButNotfound.com:${port}/-", "*:*";
|
||||
permission java.net.NetPermission "setProxySelector";
|
||||
permission java.io.FilePermission "<<ALL FILES>>", "read,write,delete";
|
||||
permission java.util.PropertyPermission "java.io.tmpdir", "read";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user