Issue Details (XML | Word | Printable)

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

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

Booting embedded engine requires read permission to derby.jar be granted for all code in the stack

Created: 15/Oct/05 03:34 AM   Updated: 30/Jun/09 12:14 AM
Return to search
Component/s: Services
Affects Version/s: 10.1.1.0, 10.2.1.6
Fix Version/s: 10.1.2.1, 10.2.1.6

Time Tracking:
Not Specified

Issue Links:
Blocker
 

Bug behavior facts: Security
Resolution Date: 02/Nov/05 04:34 AM


 Description  « Hide
When running in a security manager the embedded engine uses ClassLoader.getResources() to obtain the set of modules.properties files. This method returns an empty set if running in a security manager and permission has not been granted to read derby.jar to all code in the stack, unless the method is executed in a privileged block.

This is a regression early on in Derby's life and was not caught because of lack of testing under the security manager and was hidden by the need to grant read permission for DERBY-622.

The embedded code does not need this permission to be granted since 'Note: code can always read a file from the same directory it's in (or a subdirectory of that directory); it does not need explicit permission to do so.'

Need to re-factor code to ensure that the call to getResources and opening the resulting URL is all in a privileged block.


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Daniel John Debrunner added a comment - 15/Oct/05 03:57 AM
Blocks 615 as without granting read permission to all code every test fails when run under the security manager, and granting such permission can hide bugs.

Daniel John Debrunner made changes - 15/Oct/05 03:57 AM
Field Original Value New Value
Link This issue blocks DERBY-615 [ DERBY-615 ]
Repository Revision Date User Message
ASF #326727 Wed Oct 19 22:13:00 UTC 2005 djd DERBY-626 Re-work code to ensure that obtaining the enumeration of modules.properties
files as well as opening them is in a priviledge block. Removes the requirement for
read permission on derby.jar to be granted all the way up the stack when running with the
security manager.
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java

Repository Revision Date User Message
ASF #330110 Tue Nov 01 19:29:59 UTC 2005 djd DERBY-626 Re-work code to ensure that obtaining the enumeration of modules.properties
files as well as opening them is in a priviledge block. Removes the requirement for
read permission on derby.jar to be granted all the way up the stack when running with the
security manager.
Merge of 326727 from trunk
Files Changed
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java

Daniel John Debrunner added a comment - 02/Nov/05 03:09 AM
Will try to merge this to 10.1

Daniel John Debrunner made changes - 02/Nov/05 03:09 AM
Fix Version/s 10.1.2.1 [ 12310615 ]
Daniel John Debrunner added a comment - 02/Nov/05 04:34 AM
Changes for DERBY-615 that enable secuirty manager by default show that the bug is indeed fixed.
Trunk changes merged to 10.1 svn revision 330110.

Daniel John Debrunner made changes - 02/Nov/05 04:34 AM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 10.2.0.0 [ 11187 ]
Resolution Fixed [ 1 ]
Daniel John Debrunner made changes - 12/Jul/06 06:43 AM
Status Resolved [ 5 ] Closed [ 6 ]
Dag H. Wanvik made changes - 30/Jun/09 12:12 AM
Derby Categories [Security]
Dag H. Wanvik made changes - 30/Jun/09 12:14 AM
Component/s Security [ 11411 ]