[PATCH] implement java.security.AccessController
Casey Marshall
csm@gnu.org
Wed Jul 28 02:59:00 GMT 2004
Hi,
The attached patch implements java.security.AccessController, using
gnu.gcj.runtime.StackTrace. With this patch, and with a simple policy
file, I can get some security checks to work. Even though the stack
trace code will change (including the API?) this part of the patch is
easy to update.
Of course, there are some problems due to parts of libgcj (including
NameFinder!) that don't use a privileged action.
The bulk of this patch is what I've already applied to Classpath.
2004-07-26 Casey Marshall <csm@gnu.org>
* java/lang/SecurityManager.java: use AccessController to do
permission checks.
* java/security/AccessControlContext.java
Update copyright year.
(protectionDomain): mark final.
(combiner): likewise.
(<init>(ProtectionDomain[])): use HashSet to uniquify domains.
(<init>(ProtectionDomain[],AccessControlContext,DomainCombiner)):
new constructor.
(checkPermission): only succeed if `perm' is implied by all
protection domains.
(equals): do unordered comparison.
* java/security/AccessController.java
(doPrivileged): push and pop contexts.
(getContext): use VMAccessController.java.
* 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.
* java/util/PropertyPermissionCollection.java
(implies): avoid infinite loop.
* java/security/IntersectingDomainCombiner.java,
* java/security/VMAccessController.java,
* gnu/java/security/PolicyFile.java: new files.
--
Casey Marshall || csm@gnu.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ac.patch
Type: text/x-patch
Size: 58581 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20040728/e458b061/attachment.bin>
More information about the Java-patches
mailing list