db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1206409 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/derbynet/ functionTests/tests/jdbc4/ functionTests/tests/jdbcapi/ functionTests/tests/lang/ functionTests/tests/store/ functionTests/util/ junit/
Date Sat, 26 Nov 2011 08:11:12 GMT
Author: kahatlen
Date: Sat Nov 26 08:11:10 2011
New Revision: 1206409

URL: http://svn.apache.org/viewvc?rev=1206409&view=rev
Log:
DERBY-5514: SecureServerTest (and others) don't play nice with EMMA: AccessControlException

Grant permissions to write coverage data to all code bases, to work
around EMMA's lack of doPrivileged blocks.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/RuntimeInfoTest.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/noAbortPermission.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LDAPTests.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RoutineSecurityTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Derby3980DeadlockTest.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/RuntimeInfoTest.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/RuntimeInfoTest.policy?rev=1206409&r1=1206408&r2=1206409&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/RuntimeInfoTest.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/RuntimeInfoTest.policy
Sat Nov 26 08:11:10 2011
@@ -122,13 +122,6 @@ permission java.util.PropertyPermission 
   permission org.apache.derby.security.SystemPermission "engine", "monitor";
   permission org.apache.derby.security.SystemPermission "server", "monitor";  
  
-  // These permissions are needed when testing code instrumented with EMMA.
-  // They will only be used if the emma.active system property property is set,
-  // which should be set to "" for the permissions to be correct.
-  permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-  permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read, write";
-  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
-  
   // These permissions are needed by AssertFailure to dump the thread stack
   // traces upon failure.
   permission java.lang.RuntimePermission "getStackTrace";
@@ -251,9 +244,6 @@ grant codeBase "${derbyTesting.testjar}d
   permission org.apache.derby.security.SystemPermission "jmx", "control";
   permission org.apache.derby.security.SystemPermission "engine", "monitor";
   permission org.apache.derby.security.SystemPermission "server", "control,monitor";
-  
-  // These permissions are needed when testing code instrumented with EMMA.
-  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
 };
 
 //
@@ -343,11 +333,6 @@ grant codeBase "${derbyTesting.junit}" {
 
     // This permission is needed when running the tests using ant 1.7
     permission java.io.FilePermission "${user.dir}${/}*", "write";
-  
-    // These permissions are needed when testing code instrumented with EMMA.
-    permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-    permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read,
write";
-    permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
 };
 
 // Due to a problem running tests/derbynet/CompatibilityTest in the old test
@@ -367,11 +352,6 @@ grant codeBase "${derbyTesting.antjunit}
 
     // This permission is needed when running the tests using ant 1.7
     permission java.io.FilePermission "${user.dir}${/}*", "write";
-
-    // These permissions are needed when testing code instrumented with EMMA.
-    permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-    permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read,
write";
-    permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
 };
 
 // functionTests.tests.lang.RoutineSecurityTest requires this grant
@@ -384,6 +364,17 @@ grant {
   permission java.io.FilePermission "<<ALL FILES>>", "execute";
 };
 
+// These permissions are needed when testing code instrumented with EMMA.
+// They will only be used if the emma.active system property property is
+// set, which should be set to "" for the permissions to be correct. Must
+// be granted to all code bases because EMMA doesn't use doPrivileged
+// blocks around the code that needs the permissions.
+grant {
+  permission java.util.PropertyPermission "${emma.active}user.dir", "read";
+  permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read, write";
+  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
+};
+
 // When inserting XML values that use external DTD's, the JAXP parser
 // needs permission to read the DTD files.  We assume that all DTD
 // files will be copied to extin/ by whichever tests need them.  So
@@ -392,16 +383,6 @@ grant codeBase "${derbyTesting.jaxpjar}"
   permission java.io.FilePermission "${user.dir}${/}extin${/}-", "read";
 };
 
-
-// These permissions are needed when testing code instrumented with EMMA.
-// They are all related to writing coverage statistics to a file that by default
-// is named coverage.ec placed in the directory where the test is executed.
-grant codeBase "${derbyTesting.emma}" {
-    permission java.util.PropertyPermission "user.dir", "read";
-    permission java.io.FilePermission "${user.dir}${/}coverage.ec", "read, write";
-    permission java.lang.RuntimePermission "writeFileDescriptor";
-};
-
 // Permissions for package-private tests run from 'classes.pptesting'
 grant codeBase "${derbyTesting.ppcodeclasses}" {
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.policy?rev=1206409&r1=1206408&r2=1206409&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SysinfoTest.policy
Sat Nov 26 08:11:10 2011
@@ -121,13 +121,6 @@ grant codeBase "${derbyTesting.codejar}d
   permission org.apache.derby.security.SystemPermission "engine", "monitor";
   permission org.apache.derby.security.SystemPermission "server", "monitor";  
  
-  // These permissions are needed when testing code instrumented with EMMA.
-  // They will only be used if the emma.active system property property is set,
-  // which should be set to "" for the permissions to be correct.
-  permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-  permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read, write";
-  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
-  
   // These permissions are needed by AssertFailure to dump the thread stack
   // traces upon failure.
   permission java.lang.RuntimePermission "getStackTrace";
@@ -250,9 +243,6 @@ grant codeBase "${derbyTesting.testjar}d
   permission org.apache.derby.security.SystemPermission "engine", "monitor";
   permission org.apache.derby.security.SystemPermission "server", "control,monitor";
   
-  // These permissions are needed when testing code instrumented with EMMA.
-  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
-  
   //client side: test execs another jvm with relative path
   permission java.io.FilePermission "<<ALL FILES>>", "execute";
 };
@@ -348,11 +338,6 @@ grant codeBase "${derbyTesting.junit}" {
     // This permission is needed when running the tests using ant 1.7
     permission java.io.FilePermission "${user.dir}${/}*", "write";
   
-    // These permissions are needed when testing code instrumented with EMMA.
-    permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-    permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read,
write";
-    permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
-    
     //client side: test execs another jvm with relative path
     permission java.io.FilePermission "<<ALL FILES>>", "execute";
 };
@@ -374,11 +359,6 @@ grant codeBase "${derbyTesting.antjunit}
 
     // This permission is needed when running the tests using ant 1.7
     permission java.io.FilePermission "${user.dir}${/}*", "write";
-
-    // These permissions are needed when testing code instrumented with EMMA.
-    permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-    permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read,
write";
-    permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
 };
 
 // functionTests.tests.lang.RoutineSecurityTest requires this grant
@@ -390,6 +370,17 @@ grant {
 
 };
 
+// These permissions are needed when testing code instrumented with EMMA.
+// They will only be used if the emma.active system property property is
+// set, which should be set to "" for the permissions to be correct. Must
+// be granted to all code bases because EMMA doesn't use doPrivileged
+// blocks around the code that needs the permissions.
+grant {
+  permission java.util.PropertyPermission "${emma.active}user.dir", "read";
+  permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read, write";
+  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
+};
+
 // When inserting XML values that use external DTD's, the JAXP parser
 // needs permission to read the DTD files.  We assume that all DTD
 // files will be copied to extin/ by whichever tests need them.  So
@@ -398,16 +389,6 @@ grant codeBase "${derbyTesting.jaxpjar}"
   permission java.io.FilePermission "${user.dir}${/}extin${/}-", "read";
 };
 
-
-// These permissions are needed when testing code instrumented with EMMA.
-// They are all related to writing coverage statistics to a file that by default
-// is named coverage.ec placed in the directory where the test is executed.
-grant codeBase "${derbyTesting.emma}" {
-    permission java.util.PropertyPermission "user.dir", "read";
-    permission java.io.FilePermission "${user.dir}${/}coverage.ec", "read, write";
-    permission java.lang.RuntimePermission "writeFileDescriptor";
-};
-
 // Permissions for package-private tests run from 'classes.pptesting'
 grant codeBase "${derbyTesting.ppcodeclasses}" {
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/noAbortPermission.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/noAbortPermission.policy?rev=1206409&r1=1206408&r2=1206409&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/noAbortPermission.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/noAbortPermission.policy
Sat Nov 26 08:11:10 2011
@@ -103,13 +103,6 @@ grant codeBase "${derbyTesting.codejar}d
   permission org.apache.derby.security.SystemPermission "engine", "monitor";
   permission org.apache.derby.security.SystemPermission "server", "monitor";  
  
-  // These permissions are needed when testing code instrumented with EMMA.
-  // They will only be used if the emma.active system property property is set,
-  // which should be set to "" for the permissions to be correct.
-  permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-  permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read, write";
-  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
-  
   // These permissions are needed by AssertFailure to dump the thread stack
   // traces upon failure.
   permission java.lang.RuntimePermission "getStackTrace";
@@ -247,9 +240,6 @@ grant codeBase "${derbyTesting.testjar}d
   // applications which have not been granted the privilege to
   // abort physical connections.
   //permission java.sql.SQLPermission "callAbort";
-  
-  // These permissions are needed when testing code instrumented with EMMA.
-  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
 };
 
 //
@@ -339,11 +329,6 @@ grant codeBase "${derbyTesting.junit}" {
 
     // This permission is needed when running the tests using ant 1.7
     permission java.io.FilePermission "${user.dir}${/}*", "write";
-  
-    // These permissions are needed when testing code instrumented with EMMA.
-    permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-    permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read,
write";
-    permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
 };
 
 // Due to a problem running tests/derbynet/CompatibilityTest in the old test
@@ -363,11 +348,6 @@ grant codeBase "${derbyTesting.antjunit}
 
     // This permission is needed when running the tests using ant 1.7
     permission java.io.FilePermission "${user.dir}${/}*", "write";
-
-    // These permissions are needed when testing code instrumented with EMMA.
-    permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-    permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read,
write";
-    permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
 };
 
 // functionTests.tests.lang.RoutineSecurityTest requires this grant
@@ -377,6 +357,17 @@ grant {
     permission java.util.PropertyPermission "derbyRoutineSecurityTest.yes", "read";
 };
 
+// These permissions are needed when testing code instrumented with EMMA.
+// They will only be used if the emma.active system property property is
+// set, which should be set to "" for the permissions to be correct. Must
+// be granted to all code bases because EMMA doesn't use doPrivileged
+// blocks around the code that needs the permissions.
+grant {
+  permission java.util.PropertyPermission "${emma.active}user.dir", "read";
+  permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read, write";
+  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
+};
+
 // When inserting XML values that use external DTD's, the JAXP parser
 // needs permission to read the DTD files.  We assume that all DTD
 // files will be copied to extin/ by whichever tests need them.  So
@@ -385,16 +376,6 @@ grant codeBase "${derbyTesting.jaxpjar}"
   permission java.io.FilePermission "${user.dir}${/}extin${/}-", "read";
 };
 
-
-// These permissions are needed when testing code instrumented with EMMA.
-// They are all related to writing coverage statistics to a file that by default
-// is named coverage.ec placed in the directory where the test is executed.
-grant codeBase "${derbyTesting.emma}" {
-    permission java.util.PropertyPermission "user.dir", "read";
-    permission java.io.FilePermission "${user.dir}${/}coverage.ec", "read, write";
-    permission java.lang.RuntimePermission "writeFileDescriptor";
-};
-
 // Permissions for package-private tests run from 'classes.pptesting'
 grant codeBase "${derbyTesting.ppcodeclasses}" {
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LDAPTests.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LDAPTests.policy?rev=1206409&r1=1206408&r2=1206409&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LDAPTests.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/LDAPTests.policy
Sat Nov 26 08:11:10 2011
@@ -114,13 +114,6 @@ grant codeBase "${derbyTesting.codejar}d
   permission org.apache.derby.security.SystemPermission "engine", "monitor";
   permission org.apache.derby.security.SystemPermission "server", "monitor";  
  
-  // These permissions are needed when testing code instrumented with EMMA.
-  // They will only be used if the emma.active system property property is set,
-  // which should be set to "" for the permissions to be correct.
-  permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-  permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read, write";
-  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
-
   // resolve is needed to run ldap related tests 
   permission java.net.SocketPermission "${derbyTesting.ldapServer}", "connect, resolve";
 };
@@ -230,9 +223,6 @@ grant codeBase "${derbyTesting.testjar}d
   permission org.apache.derby.security.SystemPermission "engine", "monitor";
   permission org.apache.derby.security.SystemPermission "server", "control,monitor";
   
-  // These permissions are needed when testing code instrumented with EMMA.
-  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
-
   // resolve is needed to run ldap related tests
   permission java.net.SocketPermission "${derbyTesting.ldapServer}", "connect, resolve";
 };
@@ -317,11 +307,6 @@ grant codeBase "${derbyTesting.junit}" {
     // This permission is needed when running the tests using ant 1.7
     permission java.io.FilePermission "${user.dir}${/}*", "write";
   
-    // These permissions are needed when testing code instrumented with EMMA.
-    permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-    permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read,
write";
-    permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
-
   // resolve is needed to run ldap related tests
   permission java.net.SocketPermission "${derbyTesting.ldapServer}", "connect, resolve";
 };
@@ -343,11 +328,6 @@ grant codeBase "${derbyTesting.antjunit}
 
     // This permission is needed when running the tests using ant 1.7
     permission java.io.FilePermission "${user.dir}${/}*", "write";
-
-    // These permissions are needed when testing code instrumented with EMMA.
-    permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-    permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read,
write";
-    permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
 };
 
 // functionTests.tests.lang.RoutineSecurityTest requires this grant
@@ -357,6 +337,17 @@ grant {
     permission java.util.PropertyPermission "derbyRoutineSecurityTest.yes", "read";
 };
 
+// These permissions are needed when testing code instrumented with EMMA.
+// They will only be used if the emma.active system property property is
+// set, which should be set to "" for the permissions to be correct. Must
+// be granted to all code bases because EMMA doesn't use doPrivileged
+// blocks around the code that needs the permissions.
+grant {
+  permission java.util.PropertyPermission "${emma.active}user.dir", "read";
+  permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read, write";
+  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
+};
+
 // When inserting XML values that use external DTD's, the JAXP parser
 // needs permission to read the DTD files.  We assume that all DTD
 // files will be copied to extin/ by whichever tests need them.  So
@@ -364,13 +355,3 @@ grant {
 grant codeBase "${derbyTesting.jaxpjar}" {
   permission java.io.FilePermission "${user.dir}${/}extin${/}-", "read";
 };
-
-
-// These permissions are needed when testing code instrumented with EMMA.
-// They are all related to writing coverage statistics to a file that by default
-// is named coverage.ec placed in the directory where the test is executed.
-grant codeBase "${derbyTesting.emma}" {
-    permission java.util.PropertyPermission "user.dir", "read";
-    permission java.io.FilePermission "${user.dir}${/}coverage.ec", "read, write";
-    permission java.lang.RuntimePermission "writeFileDescriptor";
-};

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RoutineSecurityTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RoutineSecurityTest.java?rev=1206409&r1=1206408&r2=1206409&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RoutineSecurityTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RoutineSecurityTest.java
Sat Nov 26 08:11:10 2011
@@ -96,8 +96,11 @@ public class RoutineSecurityTest extends
         
         String[] restricted = {
                 "derby.system.home", // not granted to all code on the stack
-                "user.dir",  // restricted by jvm
-                // "user.home",  // restricted by jvm
+                // DERBY-5514: Property read permission on user.dir is granted
+                // to all code bases when running code instrumented with EMMA,
+                // so reading the property will succeed under EMMA.
+                // "user.dir",  // restricted by jvm
+                "user.home",  // restricted by jvm
                 "java.class.path", // restricted by jvm
                 "java.home",  // restricted by jvm
                 "derbyRoutineSecurityTest.no", // not granted at all

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Derby3980DeadlockTest.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Derby3980DeadlockTest.policy?rev=1206409&r1=1206408&r2=1206409&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Derby3980DeadlockTest.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Derby3980DeadlockTest.policy
Sat Nov 26 08:11:10 2011
@@ -124,13 +124,6 @@ grant codeBase "${derbyTesting.codejar}d
   permission org.apache.derby.security.SystemPermission "engine", "monitor";
   permission org.apache.derby.security.SystemPermission "server", "monitor";  
  
-  // These permissions are needed when testing code instrumented with EMMA.
-  // They will only be used if the emma.active system property property is set,
-  // which should be set to "" for the permissions to be correct.
-  permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-  permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read, write";
-  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
-  
   // These permissions are needed by AssertFailure to dump the thread stack
   // traces upon failure.
   permission java.lang.RuntimePermission "getStackTrace";
@@ -253,9 +246,6 @@ grant codeBase "${derbyTesting.testjar}d
   permission org.apache.derby.security.SystemPermission "jmx", "control";
   permission org.apache.derby.security.SystemPermission "engine", "monitor";
   permission org.apache.derby.security.SystemPermission "server", "control,monitor";
-  
-  // These permissions are needed when testing code instrumented with EMMA.
-  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
 };
 
 //
@@ -341,11 +331,6 @@ grant codeBase "${derbyTesting.junit}" {
 
     // This permission is needed when running the tests using ant 1.7
     permission java.io.FilePermission "${user.dir}${/}-", "read, write, delete";
-  
-    // These permissions are needed when testing code instrumented with EMMA.
-    permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-    permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read,
write";
-    permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
 };
 
 // Due to a problem running tests/derbynet/CompatibilityTest in the old test
@@ -365,11 +350,6 @@ grant codeBase "${derbyTesting.antjunit}
 
     // This permission is needed when running the tests using ant 1.7
     permission java.io.FilePermission "${user.dir}${/}*", "write";
-
-    // These permissions are needed when testing code instrumented with EMMA.
-    permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-    permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read,
write";
-    permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
 };
 
 // functionTests.tests.lang.RoutineSecurityTest requires this grant
@@ -379,6 +359,17 @@ grant {
     permission java.util.PropertyPermission "derbyRoutineSecurityTest.yes", "read";
 };
 
+// These permissions are needed when testing code instrumented with EMMA.
+// They will only be used if the emma.active system property property is
+// set, which should be set to "" for the permissions to be correct. Must
+// be granted to all code bases because EMMA doesn't use doPrivileged
+// blocks around the code that needs the permissions.
+grant {
+  permission java.util.PropertyPermission "${emma.active}user.dir", "read";
+  permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read, write";
+  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
+};
+
 // When inserting XML values that use external DTD's, the JAXP parser
 // needs permission to read the DTD files.  We assume that all DTD
 // files will be copied to extin/ by whichever tests need them.  So
@@ -387,16 +378,6 @@ grant codeBase "${derbyTesting.jaxpjar}"
   permission java.io.FilePermission "${user.dir}${/}extin${/}-", "read";
 };
 
-
-// These permissions are needed when testing code instrumented with EMMA.
-// They are all related to writing coverage statistics to a file that by default
-// is named coverage.ec placed in the directory where the test is executed.
-grant codeBase "${derbyTesting.emma}" {
-    permission java.util.PropertyPermission "user.dir", "read";
-    permission java.io.FilePermission "${user.dir}${/}coverage.ec", "read, write";
-    permission java.lang.RuntimePermission "writeFileDescriptor";
-};
-
 // Permissions for package-private tests run from 'classes.pptesting'
 grant codeBase "${derbyTesting.ppcodeclasses}" {
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy?rev=1206409&r1=1206408&r2=1206409&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
Sat Nov 26 08:11:10 2011
@@ -122,13 +122,6 @@ grant codeBase "${derbyTesting.codejar}d
   permission org.apache.derby.security.SystemPermission "engine", "monitor";
   permission org.apache.derby.security.SystemPermission "server", "monitor";  
  
-  // These permissions are needed when testing code instrumented with EMMA.
-  // They will only be used if the emma.active system property property is set,
-  // which should be set to "" for the permissions to be correct.
-  permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-  permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read, write";
-  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
-  
   // These permissions are needed by AssertFailure to dump the thread stack
   // traces upon failure.
   permission java.lang.RuntimePermission "getStackTrace";
@@ -281,9 +274,6 @@ grant codeBase "${derbyTesting.testjar}d
   // This permission is needed to call the Connection.abort(Executor) method added by JDBC
4.1
   permission java.sql.SQLPermission "callAbort";
   
-  // These permissions are needed when testing code instrumented with EMMA.
-  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
-
   // Needed by FileUtil#limitAccessToOwner
   permission java.lang.RuntimePermission "accessUserInformation";
   permission java.lang.RuntimePermission "getFileStoreAttributes";
@@ -380,11 +370,6 @@ grant codeBase "${derbyTesting.junit}" {
 
     // This permission is needed when running the tests using ant 1.7
     permission java.io.FilePermission "${user.dir}${/}*", "write";
-  
-    // These permissions are needed when testing code instrumented with EMMA.
-    permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-    permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read,
write";
-    permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
 };
 
 // Due to a problem running tests/derbynet/CompatibilityTest in the old test
@@ -404,11 +389,6 @@ grant codeBase "${derbyTesting.antjunit}
 
     // This permission is needed when running the tests using ant 1.7
     permission java.io.FilePermission "${user.dir}${/}*", "write";
-
-    // These permissions are needed when testing code instrumented with EMMA.
-    permission java.util.PropertyPermission "${emma.active}user.dir", "read";
-    permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read,
write";
-    permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
 };
 
 // functionTests.tests.lang.RoutineSecurityTest requires this grant
@@ -418,6 +398,17 @@ grant {
     permission java.util.PropertyPermission "derbyRoutineSecurityTest.yes", "read";
 };
 
+// These permissions are needed when testing code instrumented with EMMA.
+// They will only be used if the emma.active system property property is
+// set, which should be set to "" for the permissions to be correct. Must
+// be granted to all code bases because EMMA doesn't use doPrivileged
+// blocks around the code that needs the permissions.
+grant {
+  permission java.util.PropertyPermission "${emma.active}user.dir", "read";
+  permission java.io.FilePermission "${emma.active}${user.dir}${/}coverage.ec", "read, write";
+  permission java.lang.RuntimePermission "${emma.active}writeFileDescriptor";
+};
+
 // When inserting XML values that use external DTD's, the JAXP parser
 // needs permission to read the DTD files.  We assume that all DTD
 // files will be copied to extin/ by whichever tests need them.  So
@@ -426,16 +417,6 @@ grant codeBase "${derbyTesting.jaxpjar}"
   permission java.io.FilePermission "${user.dir}${/}extin${/}-", "read";
 };
 
-
-// These permissions are needed when testing code instrumented with EMMA.
-// They are all related to writing coverage statistics to a file that by default
-// is named coverage.ec placed in the directory where the test is executed.
-grant codeBase "${derbyTesting.emma}" {
-    permission java.util.PropertyPermission "user.dir", "read";
-    permission java.io.FilePermission "${user.dir}${/}coverage.ec", "read, write";
-    permission java.lang.RuntimePermission "writeFileDescriptor";
-};
-
 // Permissions for package-private tests run from 'classes.pptesting'
 grant codeBase "${derbyTesting.ppcodeclasses}" {
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java?rev=1206409&r1=1206408&r2=1206409&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/SecurityManagerSetup.java
Sat Nov 26 08:11:10 2011
@@ -277,7 +277,6 @@ public final class SecurityManagerSetup 
         URL emma = getURL("com.vladium.emma.EMMAException");
         if (emma != null) {
             classPathSet.setProperty("emma.active", "");
-            classPathSet.setProperty("derbyTesting.emma", emma.toExternalForm());
         }
 		
         /* When inserting XML values that use external DTD's, the JAXP



Mime
View raw message