From 4b3df5d6619b313119b8ffe179690318bf432918 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Thu, 30 Aug 2012 17:56:15 +0000 Subject: [PATCH] LUCENE-4337: Add a workaround for lucene.zones.apache.org's broken network configuration, also fix other possible misconfigurations of /etc/hosts: Solr sometimes connects to localhost, sometimes to 127.0.0.1, which may be different addresses. git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1379039 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/tools/junit4/tests.policy | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lucene/tools/junit4/tests.policy b/lucene/tools/junit4/tests.policy index 8264f31a589..f22126474d3 100644 --- a/lucene/tools/junit4/tests.policy +++ b/lucene/tools/junit4/tests.policy @@ -23,11 +23,23 @@ // PLEASE NOTE: You may need to enable other permissions when new tests are added, // everything not allowed here is forbidden! -grant { +grant { + // permissions for file access, write access only to sandbox: permission java.io.FilePermission "<>", "read,execute"; permission java.io.FilePermission "${tests.sandbox.dir}${/}-", "read,execute,write,delete"; + + // all possibilities of accepting/binding connections on localhost with ports >=1024: permission java.net.SocketPermission "localhost:1024-", "accept,listen"; + permission java.net.SocketPermission "127.0.0.1:1024-", "accept,listen"; + permission java.net.SocketPermission "[::1]:1024-", "accept,listen"; + + // This is a special case, because the network config of the Jenkins server is broken (INFRA-issue): + permission java.net.SocketPermission "lucene.zones.apache.org:1024-", "accept,listen"; + + // Allow connecting to the internet anywhere permission java.net.SocketPermission "*", "connect,resolve"; + + // Basic permissions needed for Lucene to work: permission java.util.PropertyPermission "*", "read,write"; permission java.lang.reflect.ReflectPermission "*"; permission java.lang.RuntimePermission "*";