Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-2109 System privileges
  3. DERBY-3482

Investigate implementing the file matching logic in DatabasePermission using FilePermission

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Services
    • Labels:
      None
    • Bug behavior facts:
      Security

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              djd Daniel John Debrunner
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: