Issue Details (XML | Word | Printable)

Key: DERBY-19
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Daniel John Debrunner
Reporter: Ramandeep Kaur
Votes: 0
Watchers: 0
Operations

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

NPE when trying to create a database at a directory that is not allowed

Created: 29/Sep/04 07:09 PM   Updated: 04/Jun/05 10:29 PM
Return to search
Component/s: Services
Affects Version/s: 10.0.2.0
Fix Version/s: 10.1.1.0

Time Tracking:
Not Specified

Resolution Date: 28/May/05 01:51 AM


 Description  « Hide
Opening this bug on behalf of Daniel Debrunner

--------------------------------------------------------------
This bug occurs in embedded Derby and Derby Network Server. In Derby Network Server, it might be best for a security exception to be thrown when trying to create a database at a disallowed directory (SQLSTATE 38000).

This bug can be reproduced in IJ like so:
(if your 'D' drive is an inaccessible disk. e.g. your CD-ROM)
ij> connect 'jdbc:derby:d:/wombat2;create=true';
ERROR XJ041: Failed to create database 'd:/wombat2'

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jan Hlavatý added a comment - 30/Sep/04 08:36 AM
This is a broader problem - you let anyone create databases whereever he wants. I dont think this is a good idea - someone might create garbage all over the server system. Maybe there should be a way to allow only certain directories.

Daniel John Debrunner added a comment - 30/Sep/04 12:21 PM
A solution to Jan's concern about the ability to create databases anywhere is to use the Java 2 security manager. Then the policy file for the JVM running Derby can limit Derby's file access as required.

Daniel John Debrunner added a comment - 28/May/05 01:51 AM
Changes committed as revision 178795.
Handle the exception thrown when accessing a path name, such as drive not ready from a CD-ROM.
Don't see how to add a test for this as a invalid name worked fine, only the exception due to drive not ready caused the problem.