summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2010-12-03 01:02:03 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2010-12-03 01:02:03 +0000
commit48e58efc8a95710ce87742f30d02a47bc494badc (patch)
tree19030cf404ce4a259ad3992fffbecec649300549
parent42df42d68b891bedae8db7e1a81ea26aa3f56bca (diff)
downloadclasspath-48e58efc8a95710ce87742f30d02a47bc494badc.tar.gz
PR46775: Ensure use of setPolicy is reflected by the default SecurityManager.
2010-12-02 Andrew John Hughes <ahughes@redhat.com> PR classpath/46775 * vm/reference/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.
-rw-r--r--ChangeLog12
-rw-r--r--vm/reference/java/security/VMAccessController.java8
2 files changed, 17 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 361e22564..8967f7c69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-02 Andrew John Hughes <ahughes@redhat.com>
+
+ PR classpath/46775
+ * vm/reference/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-11-04 Andrew John Hughes <ahughes@redhat.com>
* config.rpath:
diff --git a/vm/reference/java/security/VMAccessController.java b/vm/reference/java/security/VMAccessController.java
index 9299e6f84..6e02f5711 100644
--- a/vm/reference/java/security/VMAccessController.java
+++ b/vm/reference/java/security/VMAccessController.java
@@ -71,7 +71,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);
}
@@ -188,12 +188,13 @@ final class VMAccessController
{
Class clazz = classes[i];
String method = methods[i];
+ ClassLoader loader = clazz.getClassLoader();
if (DEBUG)
{
debug("checking " + clazz + "." + method);
// subject to getClassLoader RuntimePermission
- debug("loader = " + clazz.getClassLoader());
+ debug("loader = " + loader);
}
// If the previous frame was a call to doPrivileged, then this is
@@ -225,7 +226,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)