db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r348501 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: tests/lang/ tests/store/ util/
Date Wed, 23 Nov 2005 17:42:55 GMT
Author: djd
Date: Wed Nov 23 09:42:42 2005
New Revision: 348501

URL: http://svn.apache.org/viewcvs?rev=348501&view=rev
Log:
DERBY-615 Enable lang/errorStream.sql and store/databaseProperties.sql under the security
manager.
Add comments to a number of other tests indicating why they cannot currently run under the
security manager.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/OnlineBackupTest1_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/access_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore1_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/databaseProperties_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/encryptionKey_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/holdCursorExternalSortJDBC30_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/logDevice_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardRecovery_app.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestRoutines.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream_app.properties?rev=348501&r1=348500&r2=348501&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/errorStream_app.properties
Wed Nov 23 09:42:42 2005
@@ -17,5 +17,3 @@
 #Exclude for J2ME/Foundation - test requires javax.naming.Referenceable
 runwithfoundation=false
 
-# Haven't investigated yet
-noSecurityManager=true

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/OnlineBackupTest1_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/OnlineBackupTest1_app.properties?rev=348501&r1=348500&r2=348501&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/OnlineBackupTest1_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/OnlineBackupTest1_app.properties
Wed Nov 23 09:42:42 2005
@@ -17,5 +17,5 @@
 #Exclude for J2ME/Foundation - test requires java.sql.DriverManager
 runwithfoundation=false
 
-#exclude with SecurityManager for now
+#exclude with SecurityManager DERBY-709
 noSecurityManager=true

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/access_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/access_app.properties?rev=348501&r1=348500&r2=348501&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/access_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/access_app.properties
Wed Nov 23 09:42:42 2005
@@ -1,6 +1,6 @@
 
 usedefaults=true
 
-#exclude with SecurityManager for now
+#exclude with SecurityManager DERBY-616
 noSecurityManager=true
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore1_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore1_app.properties?rev=348501&r1=348500&r2=348501&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore1_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore1_app.properties
Wed Nov 23 09:42:42 2005
@@ -17,5 +17,5 @@
 #Exclude for J2ME/Foundation - test requires java.sql.DriverManager
 runwithfoundation=false
 
-#exclude with SecurityManager for now
+#exclude with SecurityManager DERBY-709
 noSecurityManager=true

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore_app.properties?rev=348501&r1=348500&r2=348501&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore_app.properties
Wed Nov 23 09:42:42 2005
@@ -5,5 +5,5 @@
 #Exclude for J2ME/Foundation - test requires java.sql.Driver
 runwithfoundation=false
 
-#exclude with SecurityManager for now
+#exclude with SecurityManager DERBY-709
 noSecurityManager=true

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock_app.properties?rev=348501&r1=348500&r2=348501&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bootLock_app.properties
Wed Nov 23 09:42:42 2005
@@ -9,5 +9,9 @@
 #Exclude for J2ME/Foundation - test requires java.sql.DriverManager
 runwithfoundation=false
 
-#exclude with SecurityManager for now
-noSecurityManager=true
\ No newline at end of file
+#exclude with SecurityManager
+# test execs another jvm with a relative path that means
+# the permission FilePermission("<<ALL FILES>>","execute")
+# would be required. Don't want to grant such a wide permission
+# to the testing jar.
+noSecurityManager=true

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/databaseProperties_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/databaseProperties_app.properties?rev=348501&r1=348500&r2=348501&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/databaseProperties_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/databaseProperties_app.properties
Wed Nov 23 09:42:42 2005
@@ -3,7 +3,4 @@
 
 usedefaults=true
 
-#exclude with SecurityManager for now
-noSecurityManager=true
-
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/encryptionKey_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/encryptionKey_app.properties?rev=348501&r1=348500&r2=348501&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/encryptionKey_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/encryptionKey_app.properties
Wed Nov 23 09:42:42 2005
@@ -7,6 +7,6 @@
 ij.showNoCountForSelect=true
 runwithjdk13=false
 
-#exclude with SecurityManager for now
+#exclude with SecurityManager DERBY-709
 noSecurityManager=true
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/holdCursorExternalSortJDBC30_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/holdCursorExternalSortJDBC30_app.properties?rev=348501&r1=348500&r2=348501&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/holdCursorExternalSortJDBC30_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/holdCursorExternalSortJDBC30_app.properties
Wed Nov 23 09:42:42 2005
@@ -5,6 +5,6 @@
 
 usedefaults=true
 
-#exclude with SecurityManager for now
+#exclude with SecurityManager DERBY-616
 noSecurityManager=true
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/logDevice_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/logDevice_app.properties?rev=348501&r1=348500&r2=348501&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/logDevice_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/logDevice_app.properties
Wed Nov 23 09:42:42 2005
@@ -23,6 +23,6 @@
 #Exclude for J2ME/Foundation - test requires java.sql.DriverManager
 runwithfoundation=false
 
-#exclude with SecurityManager for now
+#exclude with SecurityManager DERBY-709
 noSecurityManager=true
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup_app.properties?rev=348501&r1=348500&r2=348501&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardBackup_app.properties
Wed Nov 23 09:42:42 2005
@@ -16,5 +16,5 @@
 #Exclude for J2ME/Foundation - test requires java.sql.DriverManager
 runwithfoundation=false
 
-#exclude with SecurityManager for now
+#exclude with SecurityManager DERBY-709
 noSecurityManager=true

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardRecovery_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardRecovery_app.properties?rev=348501&r1=348500&r2=348501&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardRecovery_app.properties
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardRecovery_app.properties
Wed Nov 23 09:42:42 2005
@@ -16,5 +16,5 @@
 #Exclude for J2ME/Foundation - test requires java.sql.Driver
 runwithfoundation=false
 
-#exclude with SecurityManager for now
-noSecurityManager=true
\ No newline at end of file
+#exclude with SecurityManager DERBY-709
+noSecurityManager=true

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestRoutines.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestRoutines.java?rev=348501&r1=348500&r2=348501&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestRoutines.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/TestRoutines.java
Wed Nov 23 09:42:42 2005
@@ -20,6 +20,8 @@
 
 package org.apache.derbyTesting.functionTests.util;
 
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.sql.*;
 import java.io.*;
 import org.apache.derby.iapi.reference.JDBC30Translation;
@@ -70,9 +72,19 @@
 		TESTROUTINE.SET_SYSTEM_PROPERTY(IN PROPERTY_KEY VARCHAR(32000), IN PROPERTY_VALUE VARCHAR(32000))
 		Set a system property
 	*/
-	public static void setSystemProperty(String key, String value) {
-
-		System.getProperties().put(key, value);
+	public static void setSystemProperty(final String key, final String value) {
+		
+		// needs to run in a privileged block as it will be
+		// called through a SQL statement and thus a generated
+		// class. The generated class on the stack has no permissions
+		// granted to it.
+		AccessController.doPrivileged(new PrivilegedAction() {
+            public Object run() {
+            	System.setProperty(key, value);
+                return null; // nothing to return
+            }
+        });
+		
 	}
 	/**
 		TESTROUTINE.SLEEP(IN TIME_MS BIGINT)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy?rev=348501&r1=348500&r2=348501&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
Wed Nov 23 09:42:42 2005
@@ -119,6 +119,9 @@
   // Access all files under ${user.dir}to write the test directory structure
   permission java.io.FilePermission "${user.dir}${/}-", "read,write,delete"; 
   
+  // lang/errorStream.java
+  permission java.lang.RuntimePermission "setIO";
+  
 };
 
 //
@@ -157,6 +160,9 @@
   // These permissions are needed to load the JCE for encryption with Sun JDK131.
   // JDK14 has the JCE  preloaded
   permission java.security.SecurityPermission "insertProvider.SunJCE";
+  
+  // lang/errorStream.java
+  permission java.lang.RuntimePermission "setIO";
   
 };
 



Mime
View raw message