Harmony
  1. Harmony
  2. HARMONY-6415

[classlib][Security] policy file content parcing is different from RI

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0M12
    • Fix Version/s: 5.0M13
    • Labels:
      None
    • Environment:
      All platforms
    • Patch Info:
      Patch Available

      Description

      Please consider the following testmethod:

      public void test_policyFileEntry_contains_Quotes1() throws Exception

      { System.setProperty("java.security.policy", "resources/policyTest2.txt"); AccessController.checkPermission(new RuntimePermission("setSecurityManager")); }

      Above test passes with RI. HDK throws AccessControlException. HDK not able to parse the Policy file if the particular entries permission_class_name enclosed with quotes. But as per javadoc, policy file entry must be the following [1]. But RI allows the quotes for permission_class_name. Please find the sample policy file entry here [2]

      [1]
      permission permission_class_name ["target_name"] [, "action_list"] [, signedby "name1,...,nameN"]

      [2]
      policyTest.txt:
      ==========
      grant

      { permission java.util.PropertyPermission "user.dir", "read"; permission java.lang.RuntimePermission "createClassLoader"; permission java.io.FilePermission "<<ALL FILES>>", "delete"; permission java.io.FilePermission "<<ALL FILES>>", "read"; permission "java.util.PropertyPermission" "java.security.policy", "write"; permission "java.lang.RuntimePermission" "setSecurityManager"; permission "java.util.PropertyPermission" "java.security.policy", "read"; permission "java.lang.RuntimePermission" "setIO"; }

      ;

        Activity

        Hide
        Mohanraj Loganathan added a comment -

        Patch contains fix for this issue and the testcase.

        Show
        Mohanraj Loganathan added a comment - Patch contains fix for this issue and the testcase.
        Hide
        Regis Xu added a comment -

        Thanks Mohan!

        Patch was applied at r896308, please verify.

        Show
        Regis Xu added a comment - Thanks Mohan! Patch was applied at r896308, please verify.
        Hide
        Hudson added a comment -

        Integrated in Harmony-1.5-head-linux-x86_64 #591 (See http://hudson.zones.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/591/)
        Apply patch for : [classlib][Security] policy file content parcing is different from RI

        Show
        Hudson added a comment - Integrated in Harmony-1.5-head-linux-x86_64 #591 (See http://hudson.zones.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/591/ ) Apply patch for : [classlib] [Security] policy file content parcing is different from RI
        Hide
        Mohanraj Loganathan added a comment -

        Thanks Regis for committing the patch.

        I verified @ r896308.

        Show
        Mohanraj Loganathan added a comment - Thanks Regis for committing the patch. I verified @ r896308.

          People

          • Assignee:
            Regis Xu
            Reporter:
            Mohanraj Loganathan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 24h
              24h
              Remaining:
              Remaining Estimate - 24h
              24h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development