Investigate implementing the file matching logic in DatabasePermission using 
FilePermission
-------------------------------------------------------------------------------------------

                 Key: DERBY-3482
                 URL: https://issues.apache.org/jira/browse/DERBY-3482
             Project: Derby
          Issue Type: Sub-task
          Components: Security
            Reporter: Daniel John Debrunner
            Priority: Minor


Since the rules for the database path in DatabasePermission match 
FilePermission it might make sense to use the existing logic to determine the 
path instead of re-implementing complex logic.

I had a quick try that removed most of the code (always good) but I couldn't 
get the test SystemPrivilegesPermissionTest to run.

In initLocation after getting 'p' the only line needed was creating a file 
permission object.

        String p = url.substring(URL_PROTOCOL_DIRECTORY.length());     
        filePermission = new FilePermission(p.replace('/', File.separatorChar), 
 "read");

Then the implies method reduces to:
       return filePermission.implies(that.filePermission);

and similar for hashCode and equals.

Once the major changes for DERBY-2109 have been committed it would be a good 
item to investigate.

-- 
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