Hello

During the testing of the fix for this issue, we ran into several
AccessControlExceptions (trace below). Per Kathey's recommendation, I
modified the utils/derby_test.policy
to have read permission for extout directory:
permission java.io.FilePermission "${user.dir}${/}extout${/}-", "read,write";

After making the above change, when I run junit test for the
individual test or _Suite, the test passes without any failures.
However, suites.All still fails with the same error messages as below.

I wonder if someone has seen this or might have any recommendations?

Thanks
Ramin


testImportExportProcedureNegative(org.apache.derbyTesting.functionTests.tests.tools.ImportExportProcedureTest)junit.framework.ComparisonFailure:
Unexpected SQL state. expected:<...IE0I> but was:<...J001>
       at 
org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:624)
       at 
org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:659)
       at 
org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:673)
       at 
org.apache.derbyTesting.junit.BaseJDBCTestCase.assertStatementError(BaseJDBCTestCase.java:854)
       at 
org.apache.derbyTesting.functionTests.tests.tools.ImportExportProcedureTest.testImportExportProcedureNegative(ImportExportProcedureTest.java:1923)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
       at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at 
org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:95)
       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
       at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
       at junit.extensions.TestSetup.run(TestSetup.java:23)
       at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
       at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
       at junit.extensions.TestSetup.run(TestSetup.java:23)
       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
       at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
       at junit.extensions.TestSetup.run(TestSetup.java:23)
       at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
       at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
       at junit.extensions.TestSetup.run(TestSetup.java:23)
Caused by: java.sql.SQLException: Java exception: 'Access denied
(java.io.FilePermission extout/nodir/t1.dat read):
java.security.AccessControlException'.
       at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown
Source)
       at org.apache.derby.client.am.SqlException.getSQLException(Unknown
Source)
       at org.apache.derby.client.am.SqlException.getSQLException(Unknown
Source)
       at org.apache.derby.client.am.PreparedStatement.execute(Unknown Source)
       at 
org.apache.derbyTesting.junit.BaseJDBCTestCase.assertStatementError(BaseJDBCTestCase.java:849)
       ... 45 more
Caused by: org.apache.derby.client.am.SqlException: Java exception:
'Access denied (java.io.FilePermission extout/nodir/t1.dat read):
java.security.AccessControlException'.
       at org.apache.derby.client.am.SqlException.<init>(Unknown Source)
       at org.apache.derby.client.am.SqlException.<init>(Unknown Source)
       at org.apache.derby.client.am.Statement.completeExecute(Unknown Source)
       at 
org.apache.derby.client.net.NetStatementReply.parseEXCSQLSTTreply(Unknown
Source)
       at org.apache.derby.client.net.NetStatementReply.readExecuteCall(Unknown
Source)
       at org.apache.derby.client.net.StatementReply.readExecuteCall(Unknown
Source)
       at org.apache.derby.client.net.NetStatement.readExecuteCall_(Unknown
Source)
       at org.apache.derby.client.am.Statement.readExecuteCall(Unknown Source)
       at org.apache.derby.client.am.PreparedStatement.flowExecute(Unknown
Source)
       at org.apache.derby.client.am.PreparedStatement.executeX(Unknown Source)
On 7/11/07, Kathey Marsden (JIRA) <[EMAIL PROTECTED]> wrote:
> Prevent export from overwriting existing files
> ----------------------------------------------
>
>                  Key: DERBY-2925
>                  URL: https://issues.apache.org/jira/browse/DERBY-2925
>              Project: Derby
>           Issue Type: Sub-task
>           Components: Security, Tools
>     Affects Versions: 10.2.2.0, 10.1.2.1, 10.3.1.3, 10.4.0.0
>             Reporter: Kathey Marsden
>
>
> Export should not overwrite existing files, but rather insist that the user 
> remove them before writing to the file.  This will help prevent accidental or 
> intentional corruption of the database with export.  This may introduce a 
> compatibility issue with export but because export is usually an attended 
> utility and not typically invoked as part of an application, I think the risk 
> is worth the additional security this will provide.
>
>
>
> --
> 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