db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1625960 [2/3] - in /db/derby/code/trunk/java: drda/org/apache/derby/drda/ engine/org/apache/derby/catalog/ engine/org/apache/derby/diag/ engine/org/apache/derby/iapi/security/ engine/org/apache/derby/iapi/services/context/ engine/org/apach...
Date Thu, 18 Sep 2014 12:29:27 GMT
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java Thu Sep 18 12:29:24 2014
@@ -27,11 +27,14 @@ import org.apache.derby.iapi.reference.P
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.services.daemon.Serviceable;
 import org.apache.derby.shared.common.sanity.SanityManager;
+import org.apache.derby.iapi.services.context.Context;
 import org.apache.derby.iapi.services.context.ContextService;
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.store.access.TransactionController;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.io.Serializable;
 import java.util.Dictionary;
 
@@ -63,7 +66,7 @@ public class LanguageDbPropertySetter im
 		if (key.trim().equals(Property.SQL_AUTHORIZATION_PROPERTY))
 		{
 			LanguageConnectionContext lcc = (LanguageConnectionContext)
-					ContextService.getContext(LanguageConnectionContext.CONTEXT_ID);
+					getContext(LanguageConnectionContext.CONTEXT_ID);
 
 			if (lcc.usesSqlAuthorization() && !Boolean.valueOf((String)value).booleanValue())
 				throw StandardException.newException(SQLState.PROPERTY_UNSUPPORTED_CHANGE,
@@ -103,4 +106,29 @@ public class LanguageDbPropertySetter im
 	{
 		return null;
 	}
+    /**
+     * Privileged lookup of a Context. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  Context    getContext( final String contextID )
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getContext( contextID );
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<Context>()
+                 {
+                     public Context run()
+                     {
+                         return ContextService.getContext( contextID );
+                     }
+                 }
+                 );
+        }
+    }
+
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java Thu Sep 18 12:29:24 2014
@@ -24,6 +24,8 @@ package org.apache.derby.impl.sql.catalo
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.security.PrivilegedAction;
+import java.security.AccessController;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
@@ -63,6 +65,7 @@ import org.apache.derby.iapi.services.ca
 import org.apache.derby.iapi.services.cache.Cacheable;
 import org.apache.derby.iapi.services.cache.CacheableFactory;
 import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.services.context.Context;
 import org.apache.derby.iapi.services.context.ContextService;
 import org.apache.derby.iapi.services.daemon.IndexStatisticsDaemon;
 import org.apache.derby.iapi.services.io.FormatableBitSet;
@@ -701,7 +704,7 @@ public final class	DataDictionaryImpl
 		 * We assume the System boot process has created a context
 		 * manager already, but not that contexts we need are there.
 		 */
-		ContextService csf = ContextService.getFactory();
+		ContextService csf = getContextService();
 
 		ContextManager cm = csf.getCurrentContextManager();
 		if (SanityManager.DEBUG)
@@ -4501,7 +4504,7 @@ public final class	DataDictionaryImpl
 	public void invalidateAllSPSPlans() throws StandardException
 	{
 		LanguageConnectionContext lcc = (LanguageConnectionContext) 
-			ContextService.getContext(LanguageConnectionContext.CONTEXT_ID);
+			getContext(LanguageConnectionContext.CONTEXT_ID);
 		invalidateAllSPSPlans(lcc);
 	}
 
@@ -9523,7 +9526,7 @@ public final class	DataDictionaryImpl
             // print the lock table
             // will get a NullPointerException if lcc doesn't yet exist e.g. at boot time
             LanguageConnectionContext lcc = (LanguageConnectionContext)
-                ContextService.getContext(LanguageConnectionContext.CONTEXT_ID);
+                getContext(LanguageConnectionContext.CONTEXT_ID);
             if (lcc != null)
             {
                 long currentTime = System.currentTimeMillis();
@@ -10508,7 +10511,7 @@ public final class	DataDictionaryImpl
 
 	private static LanguageConnectionContext getLCC() {
 		return (LanguageConnectionContext) 
-					ContextService.getContextOrNull(LanguageConnectionContext.CONTEXT_ID);
+					getContextOrNull(LanguageConnectionContext.CONTEXT_ID);
 	}
 
     private SchemaDescriptor newSystemSchemaDesc(
@@ -14518,4 +14521,79 @@ public final class	DataDictionaryImpl
              );
     }
 
+    /**
+     * Privileged lookup of the ContextService. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  ContextService    getContextService()
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getFactory();
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<ContextService>()
+                 {
+                     public ContextService run()
+                     {
+                         return ContextService.getFactory();
+                     }
+                 }
+                 );
+        }
+    }
+
+    
+    /**
+     * Privileged lookup of a Context. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  Context    getContextOrNull( final String contextID )
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getContextOrNull( contextID );
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<Context>()
+                 {
+                     public Context run()
+                     {
+                         return ContextService.getContextOrNull( contextID );
+                     }
+                 }
+                 );
+        }
+    }
+
+    /**
+     * Privileged lookup of a Context. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  Context    getContext( final String contextID )
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getContext( contextID );
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<Context>()
+                 {
+                     public Context run()
+                     {
+                         return ContextService.getContext( contextID );
+                     }
+                 }
+                 );
+        }
+    }
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java Thu Sep 18 12:29:24 2014
@@ -20,6 +20,8 @@
  */
 package org.apache.derby.impl.sql.catalog;
 
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.HashMap;
 
 import org.apache.derby.catalog.SequencePreallocator;
@@ -30,6 +32,7 @@ import org.apache.derby.iapi.reference.S
 import org.apache.derby.iapi.services.cache.Cacheable;
 import org.apache.derby.iapi.services.cache.CacheManager;
 import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.services.context.Context;
 import org.apache.derby.iapi.services.context.ContextService;
 import org.apache.derby.iapi.services.i18n.MessageService;
 import org.apache.derby.iapi.services.monitor.Monitor;
@@ -469,7 +472,7 @@ public abstract class SequenceUpdater im
 				SanityManager.ASSERT( oldValue == null, "We should be flushing unused sequence values here." );
 			}
             
-            ContextService csf = ContextService.getFactory();
+            ContextService csf = getContextService();
             ContextManager cm = csf.getCurrentContextManager();
             AccessFactory af = _dd.af;
             TransactionController   dummyTransaction = af.getTransaction( cm );
@@ -592,7 +595,7 @@ public abstract class SequenceUpdater im
 	private static LanguageConnectionContext getLCC()
     {
 		return (LanguageConnectionContext) 
-					ContextService.getContextOrNull(LanguageConnectionContext.CONTEXT_ID);
+					getContextOrNull(LanguageConnectionContext.CONTEXT_ID);
 	}
 
     /** Report an unimplemented feature */
@@ -601,6 +604,57 @@ public abstract class SequenceUpdater im
         return StandardException.newException( SQLState.BTREE_UNIMPLEMENTED_FEATURE );
     }
 
+    /**
+     * Privileged lookup of the ContextService. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  ContextService    getContextService()
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getFactory();
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<ContextService>()
+                 {
+                     public ContextService run()
+                     {
+                         return ContextService.getFactory();
+                     }
+                 }
+                 );
+        }
+    }
+
+    
+    /**
+     * Privileged lookup of a Context. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  Context    getContextOrNull( final String contextID )
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getContextOrNull( contextID );
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<Context>()
+                 {
+                     public Context run()
+                     {
+                         return ContextService.getContextOrNull( contextID );
+                     }
+                 }
+                 );
+        }
+    }
+
     ///////////////////////////////////////////////////////////////////////////////////
     //
     // INNER CLASSES

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MaxMinAggregateDefinition.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MaxMinAggregateDefinition.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MaxMinAggregateDefinition.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MaxMinAggregateDefinition.java Thu Sep 18 12:29:24 2014
@@ -22,6 +22,7 @@
 package org.apache.derby.impl.sql.compile;
 
 import org.apache.derby.iapi.reference.ClassName;
+import org.apache.derby.iapi.services.context.Context;
 import org.apache.derby.iapi.services.context.ContextService;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.types.DataTypeDescriptor;
@@ -59,7 +60,7 @@ class MaxMinAggregateDefinition
 				StringBuffer aggregatorClass) 
 	{
 		LanguageConnectionContext lcc = (LanguageConnectionContext)
-			ContextService.getContext(LanguageConnectionContext.CONTEXT_ID);
+			QueryTreeNode.getContext(LanguageConnectionContext.CONTEXT_ID);
 
 			/*
 			** MIN and MAX may return null
@@ -99,4 +100,5 @@ class MaxMinAggregateDefinition
 	{
 		return(isMax);
 	}
+    
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OptimizerTracer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OptimizerTracer.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OptimizerTracer.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/OptimizerTracer.java Thu Sep 18 12:29:24 2014
@@ -28,6 +28,7 @@ import java.security.PrivilegedAction;
 import java.sql.SQLException;
 import org.apache.derby.iapi.db.OptimizerTrace;
 import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.context.Context;
 import org.apache.derby.iapi.services.context.ContextService;
 import org.apache.derby.iapi.services.i18n.MessageService;
 import org.apache.derby.iapi.services.loader.ClassFactory;
@@ -107,7 +108,7 @@ public	class   OptimizerTracer  implemen
             String  customOptTraceName = configurationParameters[ 1 ];
 
             try {
-                ClassFactoryContext cfc = (ClassFactoryContext) ContextService.getContext( ClassFactoryContext.CONTEXT_ID );
+                ClassFactoryContext cfc = (ClassFactoryContext) getContext( ClassFactoryContext.CONTEXT_ID );
                 ClassFactory    classFactory = cfc.getClassFactory();
 
                 tracer = (OptTrace) classFactory.loadApplicationClass( customOptTraceName ).newInstance();
@@ -199,5 +200,30 @@ public	class   OptimizerTracer  implemen
 
         return new SQLException( errorMessage, sqlState );
     }
+    /**
+     * Privileged lookup of a Context. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  Context    getContext( final String contextID )
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getContext( contextID );
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<Context>()
+                 {
+                     public Context run()
+                     {
+                         return ContextService.getContext( contextID );
+                     }
+                 }
+                 );
+        }
+    }
+
 }
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java Thu Sep 18 12:29:24 2014
@@ -21,6 +21,8 @@
 
 package	org.apache.derby.impl.sql.compile;
 
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.sql.Types;
 import java.util.ArrayList;
 import java.util.List;
@@ -37,6 +39,8 @@ import org.apache.derby.iapi.reference.S
 import org.apache.derby.iapi.services.classfile.VMOpcode;
 import org.apache.derby.iapi.services.compiler.MethodBuilder;
 import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.services.context.Context;
+import org.apache.derby.iapi.services.context.ContextService;
 import org.apache.derby.iapi.services.i18n.MessageService;
 import org.apache.derby.iapi.services.loader.ClassFactory;
 import org.apache.derby.iapi.services.loader.ClassInspector;
@@ -1593,4 +1597,28 @@ public abstract class QueryTreeNode impl
         return visitor.getNodes();
     }
 
+    /**
+     * Privileged lookup of a Context. Must be package protected so that user code
+     * can't call this entry point.
+     */
+    static  Context    getContext( final String contextID )
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getContext( contextID );
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<Context>()
+                 {
+                     public Context run()
+                     {
+                         return ContextService.getContext( contextID );
+                     }
+                 }
+                 );
+        }
+    }
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SumAvgAggregateDefinition.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SumAvgAggregateDefinition.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SumAvgAggregateDefinition.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SumAvgAggregateDefinition.java Thu Sep 18 12:29:24 2014
@@ -67,7 +67,7 @@ class SumAvgAggregateDefinition
 			TypeId compType = inputType.getTypeId();
 		
 			CompilerContext cc = (CompilerContext)
-				ContextService.getContext(CompilerContext.CONTEXT_ID);
+				QueryTreeNode.getContext(CompilerContext.CONTEXT_ID);
 			TypeCompilerFactory tcf = cc.getTypeCompilerFactory();
 			TypeCompiler tc = tcf.getTypeCompiler(compType);
 		

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UserAggregateDefinition.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UserAggregateDefinition.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UserAggregateDefinition.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UserAggregateDefinition.java Thu Sep 18 12:29:24 2014
@@ -100,7 +100,7 @@ class UserAggregateDefinition implements
 		try
 		{
 			CompilerContext cc = (CompilerContext)
-				ContextService.getContext(CompilerContext.CONTEXT_ID);
+				QueryTreeNode.getContext(CompilerContext.CONTEXT_ID);
             ClassFactory    classFactory = cc.getClassFactory();
             TypeCompilerFactory tcf = cc.getTypeCompilerFactory();
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericConstantActionFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericConstantActionFactory.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericConstantActionFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericConstantActionFactory.java Thu Sep 18 12:29:24 2014
@@ -23,6 +23,7 @@ package org.apache.derby.impl.sql.execut
 
 import org.apache.derby.iapi.error.StandardException;
 
+import org.apache.derby.iapi.services.context.Context;
 import org.apache.derby.iapi.services.context.ContextService;
 
 import org.apache.derby.iapi.sql.conn.Authorizer;
@@ -52,6 +53,8 @@ import org.apache.derby.impl.sql.compile
 import java.util.List;
 import java.util.Properties;
 
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.sql.Timestamp;
 
 /**
@@ -1005,7 +1008,7 @@ public class GenericConstantActionFactor
 	static protected Authorizer getAuthorizer()
 	{
 		LanguageConnectionContext lcc = (LanguageConnectionContext)
-			ContextService.getContext(LanguageConnectionContext.CONTEXT_ID);
+			getContext(LanguageConnectionContext.CONTEXT_ID);
 		return lcc.getAuthorizer();
 	}
 
@@ -1196,4 +1199,29 @@ public class GenericConstantActionFactor
 		return new MergeConstantAction( matchingClauses );
 	}
 
+    /**
+     * Privileged lookup of a Context. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  Context    getContext( final String contextID )
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getContext( contextID );
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<Context>()
+                 {
+                     public Context run()
+                     {
+                         return ContextService.getContext( contextID );
+                     }
+                 }
+                 );
+        }
+    }
+
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/JarUtil.java Thu Sep 18 12:29:24 2014
@@ -28,6 +28,7 @@ import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.security.PrivilegedActionException;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -39,6 +40,7 @@ import org.apache.derby.iapi.reference.P
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.security.Securable;
 import org.apache.derby.iapi.security.SecurityUtil;
+import org.apache.derby.iapi.services.context.Context;
 import org.apache.derby.iapi.services.context.ContextService;
 import org.apache.derby.iapi.services.io.FileUtil;
 import org.apache.derby.iapi.services.loader.ClassFactory;
@@ -438,7 +440,7 @@ public class JarUtil
 
         if (!upgrading) {
             LanguageConnectionContext lcc =
-                (LanguageConnectionContext)ContextService.getContextOrNull(
+                (LanguageConnectionContext)getContextOrNull(
                     LanguageConnectionContext.CONTEXT_ID);
 
             // DERBY-5357 UUIDs introduced in jar file names in 10.9
@@ -499,4 +501,30 @@ public class JarUtil
                 new File(oldFile.getPath()),
                 new File(newFile.getPath()), null);
     }
+    
+    /**
+     * Privileged lookup of a Context. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  Context    getContextOrNull( final String contextID )
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getContextOrNull( contextID );
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<Context>()
+                 {
+                     public Context run()
+                     {
+                         return ContextService.getContextOrNull( contextID );
+                     }
+                 }
+                 );
+        }
+    }
+
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java Thu Sep 18 12:29:24 2014
@@ -30,6 +30,7 @@ import org.apache.derby.iapi.services.ca
 import org.apache.derby.iapi.services.cache.CacheManager;
 
 import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.services.context.Context;
 import org.apache.derby.iapi.services.context.ContextService;
 import org.apache.derby.iapi.services.daemon.Serviceable;
 import org.apache.derby.iapi.services.locks.LockFactory;
@@ -66,6 +67,8 @@ import org.apache.derby.catalog.UUID;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.reference.Attribute;
 
+import java.security.PrivilegedAction;
+import java.security.AccessController;
 import java.util.Dictionary;
 import java.util.Enumeration;
 import java.util.Hashtable;
@@ -548,16 +551,16 @@ public abstract class RAMAccessManager
      */
     RAMTransactionContext getCurrentTransactionContext() {
         RAMTransactionContext rtc =
-            (RAMTransactionContext) ContextService.getContext(
+            (RAMTransactionContext) getContext(
                 AccessFactoryGlobals.RAMXACT_INTERNAL_CONTEXT_ID);
 
         if (rtc == null) {
-            rtc = (RAMTransactionContext) ContextService.getContext(
+            rtc = (RAMTransactionContext) getContext(
                     AccessFactoryGlobals.RAMXACT_CHILD_CONTEXT_ID);
         }
 
         if (rtc == null) {
-            rtc = (RAMTransactionContext) ContextService.getContext(
+            rtc = (RAMTransactionContext) getContext(
                     AccessFactoryGlobals.RAMXACT_CONTEXT_ID);
         }
 
@@ -1053,7 +1056,7 @@ public abstract class RAMAccessManager
         // Create the conglom conglom from within a separate system xact
         RAMTransaction tc =
             (RAMTransaction) getAndNameTransaction(
-                ContextService.getFactory().getCurrentContextManager(),
+                getContextService().getCurrentContextManager(),
                 AccessFactoryGlobals.USER_TRANS_NAME);
 
         // looking up lock_mode is dependant on access booting, but
@@ -1272,4 +1275,56 @@ public abstract class RAMAccessManager
 		return new CacheableConglomerate(this);
 	}
 
+    // ///////////////////////////////////////////////////////////////
+
+    /**
+     * Privileged lookup of the ContextService. Must be private so that user code
+     * can't call this entry point.
+     */
+    private static  ContextService    getContextService()
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getFactory();
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<ContextService>()
+                 {
+                     public ContextService run()
+                     {
+                         return ContextService.getFactory();
+                     }
+                 }
+                 );
+        }
+    }
+
+    /**
+     * Privileged lookup of a Context. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  Context    getContext( final String contextID )
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getContext( contextID );
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<Context>()
+                 {
+                     public Context run()
+                     {
+                         return ContextService.getContext( contextID );
+                     }
+                 }
+                 );
+        }
+    }
+
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java Thu Sep 18 12:29:24 2014
@@ -24,6 +24,7 @@ package org.apache.derby.impl.store.raw;
 import org.apache.derby.iapi.services.daemon.DaemonFactory;
 import org.apache.derby.iapi.services.daemon.DaemonService;
 import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.services.context.Context;
 import org.apache.derby.iapi.services.context.ContextService;
 import org.apache.derby.iapi.services.crypto.CipherFactoryBuilder;
 import org.apache.derby.iapi.services.crypto.CipherFactory;
@@ -67,6 +68,7 @@ import org.apache.derby.iapi.reference.M
 import org.apache.derby.iapi.reference.Property;
 
 import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.security.PrivilegedActionException;
 import java.security.SecureRandom;
 
@@ -508,7 +510,7 @@ public final class RawStore implements R
         RawTransaction t = 
                 xactFactory.findUserTransaction(
                 this,
-                ContextService.getFactory().getCurrentContextManager(), 
+                getContextService().getCurrentContextManager(), 
                 AccessFactoryGlobals.USER_TRANS_NAME);
 
         //back up blocking operations are unlogged operations.
@@ -629,7 +631,7 @@ public final class RawStore implements R
 		// to open the container through page cache
 		RawTransaction t = 
             xactFactory.findUserTransaction(this,
-                ContextService.getFactory().getCurrentContextManager(), 
+                getContextService().getCurrentContextManager(), 
                 AccessFactoryGlobals.USER_TRANS_NAME);
 
 		try {
@@ -809,7 +811,7 @@ public final class RawStore implements R
                 createBackupDirectory(backupJarDir);
 
                 LanguageConnectionContext lcc = 
-                    (LanguageConnectionContext)ContextService.getContextOrNull(
+                    (LanguageConnectionContext)getContextOrNull(
                         LanguageConnectionContext.CONTEXT_ID);
         
                 // DERBY-5357 UUIDs introduced in jar file names in 10.9
@@ -1655,7 +1657,7 @@ public final class RawStore implements R
         RawTransaction transaction =
             xactFactory.startTransaction(
                    this,
-                    ContextService.getFactory().getCurrentContextManager(),
+                    getContextService().getCurrentContextManager(),
                     AccessFactoryGlobals.USER_TRANS_NAME);
 
         try 
@@ -2824,4 +2826,56 @@ public final class RawStore implements R
             }
         }
     }
+    
+    /**
+     * Privileged lookup of the ContextService. Private so that user code
+     * can't call this entry point.
+     */
+    private static  ContextService    getContextService()
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getFactory();
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<ContextService>()
+                 {
+                     public ContextService run()
+                     {
+                         return ContextService.getFactory();
+                     }
+                 }
+                 );
+        }
+    }
+
+    
+    /**
+     * Privileged lookup of a Context. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  Context    getContextOrNull( final String contextID )
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getContextOrNull( contextID );
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<Context>()
+                 {
+                     public Context run()
+                     {
+                         return ContextService.getContextOrNull( contextID );
+                     }
+                 }
+                 );
+        }
+    }
+
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/D_DiagnosticUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/D_DiagnosticUtil.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/D_DiagnosticUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/D_DiagnosticUtil.java Thu Sep 18 12:29:24 2014
@@ -193,7 +193,7 @@ public class D_DiagnosticUtil
 
             TransactionController tc =
                 store_module.getTransaction(
-                    ContextService.getFactory().getCurrentContextManager());
+                    FileContainer.getContextService().getCurrentContextManager());
 
             ConglomerateController open_table = 
                 tc.openConglomerate(
@@ -243,7 +243,8 @@ public class D_DiagnosticUtil
 			RawStoreFactory store_module = (RawStoreFactory)
 				Monitor.findServiceModule(module, RawStoreFactory.MODULE);
 
-			xact = store_module.startInternalTransaction(ContextService.getFactory().getCurrentContextManager());
+			xact = store_module.startInternalTransaction
+                (FileContainer.getContextService().getCurrentContextManager());
 
 			ContainerKey id = new ContainerKey(segmentid, containerid);
 			ContainerHandle container = 
@@ -332,7 +333,7 @@ public class D_DiagnosticUtil
             {
                 TransactionController tc = 
                     store_module.getTransaction(
-                        ContextService.getFactory().getCurrentContextManager());
+                        FileContainer.getContextService().getCurrentContextManager());
 
                 conglom_id = tc.findConglomid(containerid);
             }
@@ -409,7 +410,7 @@ public class D_DiagnosticUtil
             {
                 TransactionController tc =
                     store_module.getTransaction(
-                        ContextService.getFactory().getCurrentContextManager());
+                        FileContainer.getContextService().getCurrentContextManager());
 
                 container_id = tc.findContainerid(conglomid);
             }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java Thu Sep 18 12:29:24 2014
@@ -62,6 +62,9 @@ import org.apache.derby.iapi.util.ByteAr
 import java.io.IOException;
 import java.io.DataInput;
 
+import java.security.PrivilegedAction;
+import java.security.AccessController;
+
 import java.util.Properties;
 import java.util.zip.CRC32;
 
@@ -1157,7 +1160,7 @@ abstract class FileContainer 
             (af == null) ? 
                 null : 
                 af.getTransaction(
-                        ContextService.getFactory().getCurrentContextManager());
+                        getContextService().getCurrentContextManager());
 
 		pageSize = 
 			PropertyUtil.getServiceInt(tc, createArgs,
@@ -3546,4 +3549,30 @@ abstract class FileContainer 
 	protected abstract void backupContainer(BaseContainerHandle handle,	
                                             String backupLocation)
 	    throws StandardException;
+    
+    /**
+     * Privileged lookup of the ContextService. Must be limited to
+     * package visibility so that user code
+     * can't call this entry point.
+     */
+    static  ContextService    getContextService()
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getFactory();
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<ContextService>()
+                 {
+                     public ContextService run()
+                     {
+                         return ContextService.getFactory();
+                     }
+                 }
+                 );
+        }
+    }
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java Thu Sep 18 12:29:24 2014
@@ -73,7 +73,7 @@ class RFResource implements FileResource
             }
 
             ContextManager cm = 
-                ContextService.getFactory().getCurrentContextManager();
+                FileContainer.getContextService().getCurrentContextManager();
 
             RawTransaction tran = 
                 factory.getRawStoreFactory().getXactFactory().findUserTransaction(
@@ -156,7 +156,7 @@ class RFResource implements FileResource
             throw StandardException.newException(SQLState.FILE_READ_ONLY);
 
         ContextManager cm =
-            ContextService.getFactory().getCurrentContextManager();
+            FileContainer.getContextService().getCurrentContextManager();
 
         RawTransaction tran =
             factory.getRawStoreFactory().getXactFactory().findUserTransaction(
@@ -188,7 +188,7 @@ class RFResource implements FileResource
 			throw StandardException.newException(SQLState.FILE_READ_ONLY);
 
 			
-		ContextManager cm = ContextService.getFactory().getCurrentContextManager();
+		ContextManager cm = FileContainer.getContextService().getCurrentContextManager();
 
         RawTransaction tran = 
             factory.getRawStoreFactory().getXactFactory().findUserTransaction(

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainer.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainer.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainer.java Thu Sep 18 12:29:24 2014
@@ -68,6 +68,7 @@ import java.io.IOException;
 import java.io.EOFException;
 import java.io.InvalidClassException;
 import java.io.Externalizable;
+import java.security.PrivilegedAction;
 import java.security.AccessController;
 import java.security.PrivilegedExceptionAction;
 import java.security.PrivilegedActionException;
@@ -409,7 +410,7 @@ class StreamFileContainer implements Typ
             (af == null) ? 
                 null : 
                 af.getTransaction(
-                    ContextService.getFactory().getCurrentContextManager());
+                    getContextService().getCurrentContextManager());
 
 		bufferSize = 
 			PropertyUtil.getServiceInt(tc, prop,
@@ -1197,4 +1198,29 @@ class StreamFileContainer implements Typ
         return null;
     }
 
+    /**
+     * Privileged lookup of the ContextService. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  ContextService    getContextService()
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getFactory();
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<ContextService>()
+                 {
+                     public ContextService run()
+                     {
+                         return ContextService.getFactory();
+                     }
+                 }
+                 );
+        }
+    }
+
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java Thu Sep 18 12:29:24 2014
@@ -89,6 +89,7 @@ import java.io.FileNotFoundException;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.security.PrivilegedActionException;
 
 import java.util.Properties;
@@ -884,7 +885,7 @@ public final class LogToFile implements 
 				RawTransaction recoveryTransaction =
                     tf.startTransaction(
                         rawStoreFactory,
-                        ContextService.getFactory().getCurrentContextManager(),
+                        getContextService().getCurrentContextManager(),
                         AccessFactoryGlobals.USER_TRANS_NAME);
 
 				// make this transaction aware that it is a recovery transaction
@@ -1671,7 +1672,7 @@ public final class LogToFile implements 
 			// start a checkpoint transaction 
 			if (needCPTran)
 				cptran = tf.startInternalTransaction(rsf,
-				ContextService.getFactory().getCurrentContextManager());
+				getContextService().getCurrentContextManager());
 
 			/////////////////////////////////////////////////////
 			// gather a snapshot of the various interesting points of the log
@@ -4956,7 +4957,7 @@ public final class LogToFile implements 
 			{
 				TransactionController tc = null;
 				tc = af.getTransaction(
-                        ContextService.getFactory().getCurrentContextManager());
+                        getContextService().getCurrentContextManager());
 				tc.setProperty(Property.LOG_ARCHIVE_MODE , "true", true);
 			}
 		}
@@ -4970,7 +4971,7 @@ public final class LogToFile implements 
 		if (af != null)
 		{
 			TransactionController tc = null;
-			tc = af.getTransaction(ContextService.getFactory().getCurrentContextManager());
+			tc = af.getTransaction(getContextService().getCurrentContextManager());
 			tc.setProperty(Property.LOG_ARCHIVE_MODE , "false", true);
 		}
         logArchived = false;
@@ -5954,4 +5955,30 @@ public final class LogToFile implements 
         }
         return sb.toString();
     }
+    
+    /**
+     * Privileged lookup of the ContextService. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  ContextService    getContextService()
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getFactory();
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<ContextService>()
+                 {
+                     public ContextService run()
+                     {
+                         return ContextService.getFactory();
+                     }
+                 }
+                 );
+        }
+    }
+
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactFactory.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactFactory.java Thu Sep 18 12:29:24 2014
@@ -60,6 +60,8 @@ import org.apache.derby.iapi.error.Stand
 
 import org.apache.derby.iapi.util.InterruptStatus;
 
+import java.security.PrivilegedAction;
+import java.security.AccessController;
 import java.util.Properties;
 import java.util.concurrent.atomic.AtomicLong;
 
@@ -138,7 +140,7 @@ public class XactFactory implements Tran
                     properties);
 		
 
-		contextFactory = ContextService.getFactory();
+		contextFactory = getContextService();
 
 		lockFactory = 
             (LockFactory) Monitor.bootServiceModule(false, this,
@@ -1161,4 +1163,30 @@ public class XactFactory implements Tran
 		}
 	}
 	
+    
+    /**
+     * Privileged lookup of the ContextService. Private so that user code
+     * can't call this entry point.
+     */
+    private static  ContextService    getContextService()
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getFactory();
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<ContextService>()
+                 {
+                     public ContextService run()
+                     {
+                         return ContextService.getFactory();
+                     }
+                 }
+                 );
+        }
+    }
+
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbedXAResource.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbedXAResource.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbedXAResource.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbedXAResource.java Thu Sep 18 12:29:24 2014
@@ -21,6 +21,8 @@
 
 package org.apache.derby.jdbc;
 
+import java.security.PrivilegedAction;
+import java.security.AccessController;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
@@ -94,7 +96,7 @@ class EmbedXAResource implements XAResou
             // RM also does not know about this xid.
             if (inDoubtCM == null)
                 throw new XAException(XAException.XAER_NOTA);
-            ContextService csf = ContextService.getFactory();
+            ContextService csf = getContextService();
             csf.setCurrentContextManager(inDoubtCM);
             try {
                 rm.commit(inDoubtCM, xid_im, onePhase);
@@ -406,7 +408,7 @@ class EmbedXAResource implements XAResou
             if (inDoubtCM == null)
                 throw new XAException(XAException.XAER_NOTA);
             
-            ContextService csf = ContextService.getFactory();
+            ContextService csf = getContextService();
             
             csf.setCurrentContextManager(inDoubtCM);
             try {
@@ -456,7 +458,7 @@ class EmbedXAResource implements XAResou
             if (inDoubtCM == null)
                 throw new XAException(XAException.XAER_NOTA);
             
-            ContextService csf = ContextService.getFactory();
+            ContextService csf = getContextService();
             
             csf.setCurrentContextManager(inDoubtCM);
             try {
@@ -929,4 +931,30 @@ class EmbedXAResource implements XAResou
         currentXid = aCurrentXid;
     }
 
+    
+    /**
+     * Privileged lookup of the ContextService. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  ContextService    getContextService()
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getFactory();
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<ContextService>()
+                 {
+                     public ContextService run()
+                     {
+                         return ContextService.getFactory();
+                     }
+                 }
+                 );
+        }
+    }
+
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedDriver.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedDriver.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedDriver.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/jdbc/EmbeddedDriver.java Thu Sep 18 12:29:24 2014
@@ -91,7 +91,6 @@ import org.apache.derby.impl.jdbc.Util;
 public class EmbeddedDriver  implements Driver {
 
 	static {
-
 		EmbeddedDriver.boot();
 	}
 
@@ -196,7 +195,14 @@ public class EmbeddedDriver  implements 
             pw = new PrintWriter(System.err, true);
         }
 
-        new JDBCBoot().boot(Attribute.PROTOCOL, pw);
+        try {
+            new JDBCBoot().boot(Attribute.PROTOCOL, pw);
+        }
+        catch (Throwable t)
+        {
+            t.printStackTrace( pw );
+            if ( t instanceof RuntimeException ) { throw (RuntimeException) t; }
+        }
 	}
 
     ////////////////////////////////////////////////////////////////////

Modified: db/derby/code/trunk/java/engine/org/apache/derby/jdbc/InternalDriver.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/jdbc/InternalDriver.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/jdbc/InternalDriver.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/jdbc/InternalDriver.java Thu Sep 18 12:29:24 2014
@@ -22,8 +22,10 @@
 
 package org.apache.derby.jdbc;
 
+import java.security.AccessController;
 import java.security.AccessControlException;
 import java.security.Permission;
+import java.security.PrivilegedAction;
 import java.sql.CallableStatement;
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
@@ -122,7 +124,7 @@ public class InternalDriver implements M
 	}
 
 	public InternalDriver() {
-		contextServiceFactory = ContextService.getFactory();
+		contextServiceFactory = getContextService();
 	}
 
 	/*
@@ -965,5 +967,31 @@ public class InternalDriver implements M
         return InternalDriver.deregister;
     }
 
+    
+    /**
+     * Privileged lookup of the ContextService. Must be private so that user code
+     * can't call this entry point.
+     */
+    private  static  ContextService    getContextService()
+    {
+        if ( System.getSecurityManager() == null )
+        {
+            return ContextService.getFactory();
+        }
+        else
+        {
+            return AccessController.doPrivileged
+                (
+                 new PrivilegedAction<ContextService>()
+                 {
+                     public ContextService run()
+                     {
+                         return ContextService.getFactory();
+                     }
+                 }
+                 );
+        }
+    }
+
 
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/security/SystemPermission.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/security/SystemPermission.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/security/SystemPermission.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/security/SystemPermission.java Thu Sep 18 12:29:24 2014
@@ -96,6 +96,11 @@ final public class SystemPermission exte
     public static final String MONITOR = "monitor";
 
     /**
+     * Action (<code>"useDerbyInternals"</code>) by the engine to lookup Derby contexts.
+     */
+    public static final String USE_DERBY_INTERNALS = "usederbyinternals";
+
+    /**
      * The legal system permission names.
      */
     static private final Set<String> LEGAL_NAMES = new HashSet<String>();    
@@ -115,6 +120,7 @@ final public class SystemPermission exte
         LEGAL_ACTIONS.add(CONTROL);
         LEGAL_ACTIONS.add(MONITOR);
         LEGAL_ACTIONS.add(SHUTDOWN);
+        LEGAL_ACTIONS.add( USE_DERBY_INTERNALS );
     }
     
     /** Constant representing {@code SystemPermission("engine, "monitor")}. */
@@ -141,7 +147,7 @@ final public class SystemPermission exte
      * @see BasicPermission#BasicPermission(String)
      */
     public SystemPermission(String name, String actions) {
-        super(name);
+        super( name );
         validateNameAndActions(name, actions);
     }
 
@@ -191,6 +197,7 @@ final public class SystemPermission exte
         // Get all the legal actions that are in actionSet, in the order
         // of LEGAL_ACTIONS.
         List<String> legalActions = new ArrayList<String>(LEGAL_ACTIONS);
+
         legalActions.retainAll(actionSet);
 
         return buildActionsString(legalActions);
@@ -400,4 +407,19 @@ final public class SystemPermission exte
             }
         }
     }
+
+    @Override
+    public String toString()
+    {
+        return getClass().getName() +
+            "( " +
+            doubleQuote( getName() ) +
+            ", " +
+            doubleQuote( actions ) +
+            " )";
+    }
+    private String  doubleQuote( String raw )
+    {
+        return "\"" + raw + "\"";
+    }
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/GetCurrentPropertiesTest.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/GetCurrentPropertiesTest.policy?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/GetCurrentPropertiesTest.policy (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/GetCurrentPropertiesTest.policy Thu Sep 18 12:29:24 2014
@@ -51,6 +51,7 @@ grant codeBase "${derbyTesting.codejar}d
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
   permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
   permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
+  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetworkServerControlApiTest.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetworkServerControlApiTest.policy?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetworkServerControlApiTest.policy (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NetworkServerControlApiTest.policy Thu Sep 18 12:29:24 2014
@@ -51,6 +51,7 @@ grant codeBase "${derbyTesting.codejar}d
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
   permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
   permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
+  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)

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=1625960&r1=1625959&r2=1625960&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 Thu Sep 18 12:29:24 2014
@@ -55,6 +55,7 @@ permission java.util.PropertyPermission 
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
   permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
   permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
+  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.policy?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.policy (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/SecureServerTest.policy Thu Sep 18 12:29:24 2014
@@ -55,6 +55,7 @@ grant codeBase "${derbyTesting.codejar}d
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
   permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
   permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
+  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ServerPropertiesTest.policy Thu Sep 18 12:29:24 2014
@@ -51,6 +51,7 @@ grant codeBase "${derbyTesting.codejar}d
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
   permission java.util.PropertyPermission "java.runtime.version", "read, write";//sysinfo
   permission java.util.PropertyPermission "java.fullversion", "read, write";//sysinfo
+  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)

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=1625960&r1=1625959&r2=1625960&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 Thu Sep 18 12:29:24 2014
@@ -54,6 +54,7 @@ grant codeBase "${derbyTesting.codejar}d
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
   permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
   permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
+  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/noDeregisterPermission.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/noDeregisterPermission.policy?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/noDeregisterPermission.policy (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/engine/noDeregisterPermission.policy Thu Sep 18 12:29:24 2014
@@ -37,6 +37,7 @@ grant codeBase "${derbyTesting.codejar}d
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
   permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
   permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
+  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)

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=1625960&r1=1625959&r2=1625960&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 Thu Sep 18 12:29:24 2014
@@ -36,6 +36,7 @@ grant codeBase "${derbyTesting.codejar}d
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
   permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
   permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
+  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)

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=1625960&r1=1625959&r2=1625960&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 Thu Sep 18 12:29:24 2014
@@ -54,6 +54,7 @@ grant codeBase "${derbyTesting.codejar}d
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
   permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
   permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
+  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NoDBInternalsPermissionTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NoDBInternalsPermissionTest.java?rev=1625960&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NoDBInternalsPermissionTest.java (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NoDBInternalsPermissionTest.java Thu Sep 18 12:29:24 2014
@@ -0,0 +1,127 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.lang.NoDBInternalsPermissionTest
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to you under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.lang;
+
+import java.io.File;
+import java.security.AccessControlException;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import junit.framework.Test;
+import org.apache.derbyTesting.junit.BaseTestSuite;
+import org.apache.derbyTesting.junit.SecurityManagerSetup;
+import org.apache.derbyTesting.junit.TestConfiguration;
+
+import org.apache.derby.iapi.services.context.ContextService;
+
+/**
+ * <p>
+ * Test backup and restore of databases with Lucene indexes.
+ * </p>
+ */
+public class NoDBInternalsPermissionTest extends GeneratedColumnsHelper
+{
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
+    // CONSTANTS
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+    private static  final   String      POLICY_FILE = "org/apache/derbyTesting/functionTests/tests/lang/no_derby_internals.policy";
+
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
+    // STATE
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
+    // CONSTRUCTOR
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * Create a new instance.
+     */
+
+    public NoDBInternalsPermissionTest( String name )
+    {
+        super( name );
+    }
+
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
+    // JUnit BEHAVIOR
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+
+    /**
+     * Construct top level suite in this JUnit test
+     */
+    public static Test suite()
+    {
+        BaseTestSuite suite = (BaseTestSuite)TestConfiguration.embeddedSuite( NoDBInternalsPermissionTest.class );
+
+        Test        secureTest = new SecurityManagerSetup( suite, POLICY_FILE );
+
+        return secureTest;
+    }
+
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
+    // TESTS
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * <p>
+     * Verify that user code can't call static entry points in ContextService.
+     * </p>
+     */
+    public  void    test_001_ContextService()
+        throws Exception
+    {
+        try {
+            ContextService.stop();
+            fail( "Should have raised an AccessControlException" );
+        }
+        catch (AccessControlException e) { println( "Caught an AccessControlException" ); }
+        try {
+            ContextService.getFactory();
+            fail( "Should have raised an AccessControlException" );
+        }
+        catch (AccessControlException e) { println( "Caught an AccessControlException" ); }
+        try {
+            ContextService.getContext( "some context id"  );
+            fail( "Should have raised an AccessControlException" );
+        }
+        catch (AccessControlException e) { println( "Caught an AccessControlException" ); }
+        try {
+            ContextService.getContextOrNull( "some context id" );
+            fail( "Should have raised an AccessControlException" );
+        }
+        catch (AccessControlException e) { println( "Caught an AccessControlException" ); }
+    }
+
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NoDBInternalsPermissionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.initial.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.initial.policy?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.initial.policy (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.initial.policy Thu Sep 18 12:29:24 2014
@@ -29,6 +29,7 @@ grant codeBase "${derbyTesting.codejar}d
       "write"; 
   permission java.io.FilePermission "${derby.system.home}","read";
   permission java.io.FilePermission "${derby.system.home}${/}-", "read,write,delete";
+  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";
 
 // getProtectionDomain is an optional permission needed for printing classpath information
 // to derby.log

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.modified.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.modified.policy?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.modified.policy (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.modified.policy Thu Sep 18 12:29:24 2014
@@ -29,6 +29,7 @@ grant codeBase "${derbyTesting.codejar}d
       "write"; 
   permission java.io.FilePermission "${derby.system.home}","read";
   permission java.io.FilePermission "${derby.system.home}${/}-", "read,write,delete";
+  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";
 
 // getProtectionDomain is an optional permission needed for printing classpath
 // information to derby.log

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.unreloadable.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.unreloadable.policy?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.unreloadable.policy (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SecurityPolicyReloadingTest.unreloadable.policy Thu Sep 18 12:29:24 2014
@@ -51,6 +51,7 @@ permission java.util.PropertyPermission 
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
   permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
   permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
+  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java Thu Sep 18 12:29:24 2014
@@ -259,6 +259,7 @@ public class _Suite extends BaseTestCase
         suite.addTest(LuceneSuite.suite());
         suite.addTest(ConsistencyCheckerTest.suite());
         suite.addTest(Derby5866TriggerOrderTest.suite());
+        suite.addTest(NoDBInternalsPermissionTest.suite());
         return suite;
 	}
 }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/luceneSupport.policy
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/luceneSupport.policy?rev=1625960&r1=1625959&r2=1625960&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/luceneSupport.policy (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/luceneSupport.policy Thu Sep 18 12:29:24 2014
@@ -55,6 +55,7 @@ grant codeBase "${derbyTesting.codejar}d
   permission java.util.PropertyPermission "java.class.path", "read";//sysinfo
   permission java.util.PropertyPermission "java.runtime.version", "read";//sysinfo
   permission java.util.PropertyPermission "java.fullversion", "read";//sysinfo
+  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";
   
   // unit tests (e.g. store/T_RecoverFullLog) set this property 
   // (called from derbyTesting.jar through code in derby.jar)



Mime
View raw message