2004-09-26 Casey Marshall <csm@gnu.org>

* java/security/ProtectionDomain.java
       (<init>(CodeSource,PermissionCollection)): set `staticBinding' to
       `true'.

       * java/security/SecureClassLoader.java
       (defineClass): make protection domain dynamically bound.
       (getPermissions): call `getCurrentPolicy' to avoid permission
       check.

From-SVN: r88127
This commit is contained in:
Casey Marshall 2004-09-26 14:47:41 +00:00 committed by Mark Wielaard
parent 68629d160e
commit 59c86e4b88
3 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,14 @@
2004-09-26 Casey Marshall <csm@gnu.org>
* java/security/ProtectionDomain.java
(<init>(CodeSource,PermissionCollection)): set `staticBinding' to
`true'.
* java/security/SecureClassLoader.java
(defineClass): make protection domain dynamically bound.
(getPermissions): call `getCurrentPolicy' to avoid permission
check.
2004-09-25 Mark Wielaard <mark@klomp.org>
* Makefile.am (core_java_source_files): Add VMTimeZone.java.

View File

@ -83,7 +83,7 @@ public class ProtectionDomain
*/
public ProtectionDomain(CodeSource codesource, PermissionCollection permissions)
{
this(codesource, permissions, null, null, false);
this(codesource, permissions, null, null, true);
}
/**

View File

@ -84,7 +84,7 @@ public class SecureClassLoader extends ClassLoader
if (cs != null)
{
ProtectionDomain protectionDomain
= new ProtectionDomain(cs, getPermissions(cs));
= new ProtectionDomain(cs, getPermissions(cs), this, null);
return super.defineClass(name, b, off, len, protectionDomain);
}
else
@ -102,7 +102,7 @@ public class SecureClassLoader extends ClassLoader
*/
protected PermissionCollection getPermissions(CodeSource cs)
{
Policy policy = Policy.getPolicy();
Policy policy = Policy.getCurrentPolicy();
return policy.getPermissions(cs);
}
}