Affects Version/s: None
Fix Version/s: None
Bug behavior facts:Security
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:
and similar for hashCode and equals.
Once the major changes for DERBY-2109 have been committed it would be a good item to investigate.