[ 
https://issues.apache.org/jira/browse/DERBY-2556?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kathey Marsden updated DERBY-2556:
----------------------------------

    Attachment: derby-2556-4a_alternative-patch.diff

Thanks Kristian for the patch.

I did not notice your alternative patch until after I had made another patch 
myself.  I preferred yours so made the changes to StorageFactoryService and 
corrected a small compile error in the patch.
I seem to be having inconsistant results running these tests.  Now I am seeing 
errors starting the database with the trace below.  This is what I was getting 
when I first tried your patch and may be related to my environment.  Anyway 
could you give it a try and commit if it works ok for you.

Thanks

Kathey

....XSDG8 : Unable to copy directory 'verifyKey.dat' to 'C:\test\extinout\restor
erifyKey.dat' during restore. Please make sure that there is enough space and pe
java.sql.SQLException: Unable to copy directory 'verifyKey.dat' to 'C:\test\exti
mRestored\verifyKey.dat' during restore. Please make sure that there is enough s
        at org.apache.derby.iapi.error.StandardException.newException(StandardEx
        at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privRestoreD
02)
        at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(BaseData
        at java.security.AccessController.doPrivileged1(Native Method)
        at java.security.AccessController.doPrivileged(AccessController.java(Com
        at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.restoreDataD
        at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(BaseDat
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.j
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopServi
        at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMo
        at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Moni
        at org.apache.derby.impl.store.raw.RawStore.boot(RawStore.java:183)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.j
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopServi
        at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMo
        at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Moni
        at org.apache.derby.impl.store.access.RAMAccessManager.boot(RAMAccessMan
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.j
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopServi
        at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMo
        at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Moni
        at org.apache.derby.impl.db.BasicDatabase.bootStore(BasicDatabase.java:7
        at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:196)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.j
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopServi
        at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMo
        at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderServi
        at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndSta
        at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentSer
        at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService
        at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnecti
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.jav
        at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(EmbedConnection30
        at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Driver30.java:80
        at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:209)
        at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSo
        at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(EmbeddedDataSo
        at org.apache.derbyTesting.functionTests.tests.store.EncryptionKeyTest.g

        at org.apache.derbyTesting.functionTests.tests.store.EncryptionKeyTest.a
        at org.apache.derbyTesting.functionTests.tests.store.EncryptionKeyTest$2
        at java.security.AccessController.doPrivileged1(Native Method)
        at java.security.AccessController.doPrivileged(AccessController.java(Com
        at org.apache.derbyTesting.functionTests.tests.store.EncryptionKeyTest.g
.java:552)
        at org.apache.derbyTesting.functionTests.tests.store.EncryptionKeyTest.t
java:280)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
        at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at junit.textui.TestRunner.doRun(TestRunner.java:116)
        at junit.textui.TestRunner.start(TestRunner.java:172)
        at junit.textui.TestRunner.main(TestRunner.java:138)




> Code paths for db restore do not use doPrivileged-calls, causing 
> SecurityException
> ----------------------------------------------------------------------------------
>
>                 Key: DERBY-2556
>                 URL: https://issues.apache.org/jira/browse/DERBY-2556
>             Project: Derby
>          Issue Type: Bug
>          Components: Services
>    Affects Versions: 10.2.2.0, 10.3.0.0
>         Environment: Derby running with a security manager.
>            Reporter: Kristian Waagan
>         Assigned To: Kathey Marsden
>             Fix For: 10.3.0.0
>
>         Attachments: derby-2556-2a_whitespace-javadoc.diff, 
> derby-2556-3a_alternative-patch.diff, derby-2556-3a_alternative-patch.stat, 
> derby-2556-4a_alternative-patch.diff, derby-2556-4a_alternative-patch.stat, 
> derby-2556_diff.txt, derby-2556_stat.txt
>
>
> When using 'createFrom' or 'restoreFrom' in the JDBC url to restore a 
> database from a backup image, a SecurityException is thrown even though the 
> policyfile for codebase derby.jar is correctly configured (giving Derby 
> access to the backup image).
> A few comments on this issue can be found here (and in subsequent comments): 
> https://issues.apache.org/jira/browse/DERBY-1001#action_12439811
> A workaround is wrapping the connection call in doPrivileged at the 
> "application-level code", or granting the required permissions to the 
> application codebase as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to