Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6415

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.0M12
    • 5.0M13
    • None
    • All platforms
    • 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";
      };

      Attachments

        Activity

          People

            regis_xu Regis Xu
            mohlogan 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