Issue Details (XML | Word | Printable)

Key: DERBY-616
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Suresh Thalamati
Reporter: Daniel John Debrunner
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

create index can fail under the SecurityManager when trying to access files in the tmp folder of a database

Created: 12/Oct/05 03:09 AM   Updated: 12/Jul/06 06:48 AM
Return to search
Component/s: Store
Affects Version/s: 10.0.2.1, 10.1.1.0, 10.2.1.6
Fix Version/s: 10.1.3.1, 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby-616.diff 2006-03-08 03:42 AM Suresh Thalamati 12 kB
Issue Links:
Reference
 

Resolution Date: 11/Mar/06 02:31 AM


 Description  « Hide
Seen in tests lang/wisconsin.sql and jdbcapi/maxfieldsize.java when running with the network server and the new security policy file that grants permisions on a per-jar basis. Unless permission is given to the network serve code (since it is in the stack) to access temp files in the database the test will fail.

  permission java.io.FilePermission "${derby.system.home}${/}wombat${/}tmp${/}-", "read, write, delete";

Most likely the temp files are being accessed in without a privileged block.

Easy to reproduce once the new policy file changes are checked in (see http://wiki.apache.org/db-derby/SecurityManagerTesting) by removing the permission in the derby_tests.policy file and running these tests using the jar files.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #329310 Fri Oct 28 21:40:43 UTC 2005 djd DERBY-615 In unit tests use System.setProperty() instead of System.getProperties().put()
to set system properties. Means more specific permissions can be granted in the policy file.
Disable testsqldecimal from running with the security manager due to DERBY-616.
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/copyfiles.ant
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/unit/T_CipherBlowfish_app.properties
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverBadLog.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_SortController.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/unitTests/store/T_RecoverFullLog.java
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/testsqldecimal_app.properties

Myrna van Lunteren added a comment - 12/Feb/06 07:42 AM
DERBY-943 is most likely related to this issue.
See also the mail archives:
http://mail-archives.apache.org/mod_mbox/db-derby-dev/200602.mbox/%3cc25576af0602110801w12544eb7i517b984f0e1b7651@mail.gmail.com%3e
and:
http://mail-archives.apache.org/mod_mbox/db-derby-dev/200602.mbox/%3c43EE0E60.7000103@apache.org%3e

So, For 'fixing' the nightly failure issue of DERBY-943, I will add the read, write, delete java.io.FilePermission to derby_tests.policy for the syscatdb/tmp dir (and under) in the derbynet.jar section. When this (DERBY-616) bug gets fixed, that section should also be taken out, and syscat.sql should be confirmed to work successfully with ibm142 jvm.


Myrna van Lunteren made changes - 12/Feb/06 10:49 AM
Field Original Value New Value
Link This issue relates to DERBY-943 [ DERBY-943 ]
Repository Revision Date User Message
ASF #377555 Tue Feb 14 00:58:52 UTC 2006 fuzzylogic DERBY-943: Fix syscat.sql failure by adding permissions to policy file. Related
to DERBY-616.

Committed for Myrna Van Lunteren <m.v.lunteren@gmail.com>
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy

Suresh Thalamati made changes - 15/Feb/06 10:00 AM
Assignee Suresh Thalamati [ tsuresh ]
Suresh Thalamati added a comment - 08/Mar/06 03:42 AM
DERBY-616:

-- Added a missing privileged blocks for I/O call in StreamFileContainer.java ,
this class is used by the sort during index creation ..etc.
   
-- Enabled some of the tests which were not running under security manager
   earlier because of this bug to run by default with security manager.

-- removed the additional permissions from the derby test policy file
   that were added earlier to avoid this bug for some test cases.

TESTS : derbyall test suite passed on Windows XP/JDK142/ with sane classes
directory and insane jars.

It would be great if some can review and commit this patch.

svn stat:
M java\engine\org\apache\derby\impl\store\raw\data\StreamFileContainer.java

M java\testing\org\apache\derbyTesting\functionTests\tests\lang\compressTable_app.properties
M java\testing\org\apache\derbyTesting\functionTests\tests\lang\authorize_app.properties
M java\testing\org\apache\derbyTesting\functionTests\tests\lang\wisconsin_app.properties
M java\testing\org\apache\derbyTesting\functionTests\tests\lang\syscat_app.properties
M java\testing\org\apache\derbyTesting\functionTests\tests\store\holdCursorExternalSortJDBC30_app.properties
M java\testing\org\apache\derbyTesting\functionTests\tests\store\access_app.properties
M java\testing\org\apache\derbyTesting\functionTests\tests\store\testsqldecimal_app.properties
M java\testing\org\apache\derbyTesting\functionTests\util\derby_tests.policy

Suresh Thalamati made changes - 08/Mar/06 03:42 AM
Attachment derby-616.diff [ 12323880 ]
Suresh Thalamati made changes - 08/Mar/06 03:43 AM
Status Open [ 1 ] In Progress [ 3 ]
Repository Revision Date User Message
ASF #384282 Wed Mar 08 17:51:15 UTC 2006 mikem DERBY-616, committing on behalf of Suresh Thalamati

- Added a missing privileged blocks for I/O call in StreamFileContainer.java ,
this class is used by the sort during index creation ..etc.

-- Enabled some of the tests which were not running under security manager
earlier because of this bug to run by default with security manager.

-- removed the additional permissions from the derby test policy file
that were added earlier to avoid this bug for some test cases.
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/access_app.properties
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/syscat_app.properties
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainer.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable_app.properties
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/authorize_app.properties
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/wisconsin_app.properties
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/holdCursorExternalSortJDBC30_app.properties
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/testsqldecimal_app.properties

Mike Matrigali added a comment - 09/Mar/06 01:52 AM
I have reviewed, tested and committed the submitted patch for this issue.

m1_142:13>svn commit

Sending java\engine\org\apache\derby\impl\store\raw\data\StreamFileContai
ner.java
Sending java\testing\org\apache\derbyTesting\functionTests\tests\lang\aut
horize_app.properties
Sending java\testing\org\apache\derbyTesting\functionTests\tests\lang\com
pressTable_app.properties
Sending java\testing\org\apache\derbyTesting\functionTests\tests\lang\sys
cat_app.properties
Sending java\testing\org\apache\derbyTesting\functionTests\tests\lang\wis
consin_app.properties
Sending java\testing\org\apache\derbyTesting\functionTests\tests\store\ac
cess_app.properties
Sending java\testing\org\apache\derbyTesting\functionTests\tests\store\ho
ldCursorExternalSortJDBC30_app.properties
Sending java\testing\org\apache\derbyTesting\functionTests\tests\store\te
stsqldecimal_app.properties
Sending java\testing\org\apache\derbyTesting\functionTests\util\derby_tes
ts.policy
Transmitting file data .........
Committed revision 384282.

Suresh Thalamati made changes - 11/Mar/06 02:31 AM
Fix Version/s 10.2.0.0 [ 11187 ]
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Repository Revision Date User Message
ASF #397945 Fri Apr 28 16:31:03 UTC 2006 mikem DERBY-616

backporting fix for DERBY-616 (svn 384282) from trunk into 10.1 branch,
targeted for upcoming 10.1.3 release.

original notes for fix:

o Added a missing privileged blocks for I/O call in StreamFileContainer.java ,
this class is used by the sort during index creation ..etc.

o Enabled some of the tests which were not running under security manager
earlier because of this bug to run by default with security manager.

o removed the additional permissions from the derby test policy file
 that were added earlier to avoid this bug for some test cases.
Files Changed
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainer.java
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/authorize_app.properties
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/wisconsin_app.properties

Mike Matrigali added a comment - 28/Apr/06 11:31 PM
backported this fix from trunk into 10.1 line:

m101_142:62>svn commit

Sending java\engine\org\apache\derby\impl\store\raw\data\StreamFileContai
ner.java
Sending java\testing\org\apache\derbyTesting\functionTests\tests\lang\aut
horize_app.properties
Sending java\testing\org\apache\derbyTesting\functionTests\tests\lang\wis
consin_app.properties
Sending java\testing\org\apache\derbyTesting\functionTests\util\derby_tes
ts.policy
Transmitting file data ....
Committed revision 397945.

Mike Matrigali made changes - 28/Apr/06 11:31 PM
Fix Version/s 10.1.3.0 [ 12310616 ]
Fix Version/s 10.1.2.4 [ 12310880 ]
Daniel John Debrunner made changes - 12/Jul/06 06:48 AM
Status Resolved [ 5 ] Closed [ 6 ]