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

[classlib][security] Harmony cannot identify 'codeBase' feature in policy file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Classlib
    • None

    Description

      create a simple policy file and then run PolicyTest with the argument and the policy file[1] as following on Windows XP:

      -Dtest.bin.dir=c:\api\ -Djava.security.policy=<policy file path>

      public class PolicyTest {
      public static void main(String[] args) throws Exception {
      Policy p = Policy.getPolicy();
      ProtectionDomain pd = new ProtectionDomain(new CodeSource(new URL(
      "file:/c:/api/*"), (java.security.cert.Certificate[]) null), null);
      PermissionCollection pCollection = p.getPermissions(pd);
      Enumeration<Permission> elements = pCollection.elements();
      while (elements.hasMoreElements()) {
      if(elements.nextElement().equals(new AllPermission()))

      { System.out.println("contains AllPermission"); }

      }
      }
      }

      RI prints:
      contains AllPermission

      while Harmony prints nothing.

      [1]
      grant codeBase "file:${test.bin.dir}/-" {
      permission java.security.AllPermission;
      };

      Attachments

        1. H-2910_upd.patch
          7 kB
          Mikhail Markov
        2. Harmony-2910.diff
          6 kB
          Stepan Mishura
        3. Harmony-2910.diff
          6 kB
          Ruth Cao
        4. Harmony-2910.diff
          0.9 kB
          Ruth Cao
        5. Harmony-2910-2.zip
          2 kB
          Ruth Cao
        6. Harmony-2910-fix.patch
          5 kB
          Vasily Zakharov
        7. Harmony-2910-Fix.patch
          7 kB
          Vasily Zakharov
        8. Harmony-2910-Fix.patch
          7 kB
          Vasily Zakharov
        9. Harmony-2910-PolicyEntryTest.patch
          2 kB
          Vasily Zakharov
        10. Harmony-2910-PolicyTest.patch
          2 kB
          Vasily Zakharov
        11. Harmony-2910-Test.patch
          14 kB
          Vasily Zakharov
        12. Harmony-2910-Test.patch
          14 kB
          Vasily Zakharov
        13. regressionTest2910.txt
          3 kB
          Stepan Mishura

        Issue Links

          Activity

            People

              tellison Tim Ellison
              ruth.cao Ruth Cao
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: