]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR libgcj/46774: Create dynamic ProtectionDomain instances which check the system...
authorAndrew John Hughes <ahughes@redhat.com>
Mon, 20 Dec 2010 18:19:52 +0000 (18:19 +0000)
committerAndrew John Hughes <gandalf@gcc.gnu.org>
Mon, 20 Dec 2010 18:19:52 +0000 (18:19 +0000)
2010-12-13  Andrew John Hughes  <ahughes@redhat.com>

    PR libgcj/46774
    * libjava/java/security/VMAccessController.java:
    (DEFAULT_CONTEXT): Create ProtectionDomain with
    four argument constructor (arguments are the same
    as those implied by the two argument constructor).
    (getContext()): Create ProtectionDomain instances
    with four argument constructor using a null Principal
    array (as before) but including the classloader, which
    was always null before.

From-SVN: r168092

libjava/ChangeLog
libjava/classpath/lib/java/security/VMAccessController.class
libjava/java/security/VMAccessController.java

index 036bdddc0ae73101652a606522008d59cf59e9f6..94e698eca8f29089e9316a4f6c81a4af839c3635 100644 (file)
@@ -1,3 +1,15 @@
+2010-12-13  Andrew John Hughes  <ahughes@redhat.com>
+
+       PR libgcj/46774
+       * libjava/java/security/VMAccessController.java:
+       (DEFAULT_CONTEXT): Create ProtectionDomain with
+       four argument constructor (arguments are the same
+       as those implied by the two argument constructor).
+       (getContext()): Create ProtectionDomain instances
+       with four argument constructor using a null Principal
+       array (as before) but including the classloader, which
+       was always null before.
+
 2010-12-16  Release Manager
 
        * GCC 4.5.2 released.
index d05cd9c84563057d1913a73bbf76e0f79f1b626d..9a129803916b867882348cf74e336fe473881338 100644 (file)
Binary files a/libjava/classpath/lib/java/security/VMAccessController.class and b/libjava/classpath/lib/java/security/VMAccessController.class differ
index 8436c9ccb60b8ccb7c5d4004ff31d4da17cda478..587f311142d103a39b80fbba4e2d13f23415cae9 100644 (file)
@@ -56,7 +56,7 @@ final class VMAccessController
     Permissions permissions = new Permissions();
     permissions.add(new AllPermission());
     ProtectionDomain[] domain = new ProtectionDomain[] {
-      new ProtectionDomain(source, permissions)
+      new ProtectionDomain(source, permissions, null, null)
     };
     DEFAULT_CONTEXT = new AccessControlContext(domain);
   }
@@ -178,12 +178,13 @@ final class VMAccessController
     for (int i = 3; i < classes.length; i++)
       {
         Class clazz = classes[i];
+        ClassLoader loader = clazz.getClassLoader();
 
         if (DEBUG)
           {
             debug("checking " + clazz);
             // subject to getClassLoader RuntimePermission
-            debug("loader = " + clazz.getClassLoader());
+            debug("loader = " + loader);
           }
 
         if (privileged && i == classes.length - 2)
@@ -208,7 +209,8 @@ final class VMAccessController
         // Create a static snapshot of this domain, which may change over time
         // if the current policy changes.
         domains.add(new ProtectionDomain(domain.getCodeSource(),
-                                         domain.getPermissions()));
+                                         domain.getPermissions(),
+                                         loader, null));
       }
 
     if (DEBUG)