[kaffe] CVS kaffe (dalibor): implement AccessController.getContext

Kaffe CVS Kaffe Mailing List <kaffe@kaffe.org>
Mon May 31 14:51:02 2004


PatchSet 4801 
Date: 2004/05/31 21:15:05
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
implement AccessController.getContext

2004-05-31  Casey Marshall <csm@gnu.org>

        * include/Makefile.am: added java_security_VMAccessController.h.
        * include/Makefile.in: updated.
        * libraries/clib/native/AccessController.c: new file.
        * libraries/clib/native/Makefile.am: add AccessController.c.
        * libraries/clib/native/Makefile.in: updated.
        * libraries/javalib/bootstrap.classlist: add java.security
        classes.
        * libraries/javalib/essential.files: add java.security classes.
        * libraries/javalib/gnu/java/security/PolicyFile.java
        (debug): don't check 'DEBUG' here. Changed all calls to check
        'DEBUG' before calling 'debug'.
        * libraries/javalib/java/lang/SecurityManager.java
        (getSecurityContext): return AccessController.getContext().
        (checkPermission): call AccessController.checkPermission().
        (checkPermission(Permission,Object)): call checkPermission of
        'context' if it is an AccessControlContext.
        (checkRead): likewise.
        (checkConnect): likewise.
        * libraries/javalib/java/net/SocketPermission.java
        (implies): check 'actions' list properly.
        * libraries/javalib/java/security/AccessControlContext.java:
        Use Classpath's version as base.
        (<init>): copy ProtectionDomains properly.
        (checkPermission): only succeed if the permission is implied by
        every domain in the list.
        * libraries/javalib/java/security/AccessController.java:
        Use Classpath's version as base.
        (doPrivileged): call VMAccessController.pushContext and
        VMAccessController.popContext if a context is supplied.
        (getContext): implemented.
        * libraries/javalib/java/security/IntersectingDomainCombiner.java:
        new file.
        * libraries/javalib/java/security/ProtectionDomain.java
        (<init>): set statically bound to 'true' in the two-argument
        version.
        * libraries/javalib/java/security/SecureClassLoader.java
        Use Classpath's version as base.
        (getPermissions): call 'Policy.getCurrentPolicy' to bypass
        security check.
        * libraries/javalib/java/security/VMAccessController.java: new
        file.
        * libraries/javalib/java/util/PropertyPermissionCollection.java
        (implies): avoid infinite loop.
        * libraries/javalib/kaffe/lang/PrimordialClassLoader.java
        (DEFAULT_PROTECTION_DOMAIN): set permissions to 'AllPermissions'.

Members: 
	ChangeLog:1.2370->1.2371 
	include/Makefile.am:1.60->1.61 
	include/Makefile.in:1.158->1.159 
	libraries/clib/native/Makefile.am:1.32->1.33 
	libraries/clib/native/Makefile.in:1.135->1.136 
	libraries/javalib/Klasses.jar.bootstrap:1.59->1.60 
	libraries/javalib/Makefile.am:1.192->1.193 
	libraries/javalib/Makefile.in:1.256->1.257 
	libraries/javalib/bootstrap.classlist:1.50->1.51 
	libraries/javalib/essential.files:1.45->1.46 
	libraries/javalib/gnu/java/security/PolicyFile.java:1.2->1.3 
	libraries/javalib/java/lang/SecurityManager.java:1.19->1.20 
	libraries/javalib/java/net/SocketPermission.java:1.4->1.5 
	libraries/javalib/java/security/AccessControlContext.java:1.2->1.3 
	libraries/javalib/java/security/AccessController.java:1.1->1.2 
	libraries/javalib/java/security/ProtectionDomain.java:1.2->1.3 
	libraries/javalib/java/security/SecureClassLoader.java:1.5->1.6 
	libraries/javalib/java/util/PropertyPermissionCollection.java:1.1->1.2 
	libraries/javalib/kaffe/lang/PrimordialClassLoader.java:1.5->1.6 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2370 kaffe/ChangeLog:1.2371
--- kaffe/ChangeLog:1.2370	Mon May 31 20:03:18 2004
+++ kaffe/ChangeLog	Mon May 31 21:15:05 2004
@@ -1,3 +1,51 @@
+2004-05-31  Casey Marshall <csm@gnu.org>
+
+	* include/Makefile.am: added java_security_VMAccessController.h.
+	* include/Makefile.in: updated.
+	* libraries/clib/native/AccessController.c: new file.
+	* libraries/clib/native/Makefile.am: add AccessController.c.
+	* libraries/clib/native/Makefile.in: updated.
+	* libraries/javalib/bootstrap.classlist: add java.security
+	classes.
+	* libraries/javalib/essential.files: add java.security classes.
+	* libraries/javalib/gnu/java/security/PolicyFile.java
+	(debug): don't check `DEBUG' here. Changed all calls to check
+	`DEBUG' before calling `debug'.
+	* libraries/javalib/java/lang/SecurityManager.java
+	(getSecurityContext): return AccessController.getContext().
+	(checkPermission): call AccessController.checkPermission().
+	(checkPermission(Permission,Object)): call checkPermission of
+	`context' if it is an AccessControlContext.
+	(checkRead): likewise.
+	(checkConnect): likewise.
+	* libraries/javalib/java/net/SocketPermission.java
+	(implies): check `actions' list properly.
+	* libraries/javalib/java/security/AccessControlContext.java:
+	Use Classpath's version as base.
+	(<init>): copy ProtectionDomains properly.
+	(checkPermission): only succeed if the permission is implied by
+	every domain in the list.
+	* libraries/javalib/java/security/AccessController.java:
+	Use Classpath's version as base.
+	(doPrivileged): call VMAccessController.pushContext and
+	VMAccessController.popContext if a context is supplied.
+	(getContext): implemented.
+	* libraries/javalib/java/security/IntersectingDomainCombiner.java:
+	new file.
+	* libraries/javalib/java/security/ProtectionDomain.java
+	(<init>): set statically bound to `true' in the two-argument
+	version.
+	* libraries/javalib/java/security/SecureClassLoader.java
+	Use Classpath's version as base.
+	(getPermissions): call `Policy.getCurrentPolicy' to bypass
+	security check.
+	* libraries/javalib/java/security/VMAccessController.java: new
+	file.
+	* libraries/javalib/java/util/PropertyPermissionCollection.java
+	(implies): avoid infinite loop.
+	* libraries/javalib/kaffe/lang/PrimordialClassLoader.java
+	(DEFAULT_PROTECTION_DOMAIN): set permissions to `AllPermissions'.
+
 2004-05-31  Michael Franz  <developer.franz@verizon.net>
 
 	* libraries/clib/management/JIT.c,
Index: kaffe/include/Makefile.am
diff -u kaffe/include/Makefile.am:1.60 kaffe/include/Makefile.am:1.61
--- kaffe/include/Makefile.am:1.60	Wed May 19 17:27:44 2004
+++ kaffe/include/Makefile.am	Mon May 31 21:15:15 2004
@@ -83,6 +83,7 @@
 	java_net_SocketAddress.h \
 	java_net_SocketImpl.h \
 	java_net_SocketOptions.h \
+	java_security_VMAccessController.h \
 	java_text_DateFormat.h \
 	java_util_Arrays.h \
 	java_util_Comparator.h \
Index: kaffe/include/Makefile.in
diff -u kaffe/include/Makefile.in:1.158 kaffe/include/Makefile.in:1.159
--- kaffe/include/Makefile.in:1.158	Tue May 25 08:33:22 2004
+++ kaffe/include/Makefile.in	Mon May 31 21:15:16 2004
@@ -395,6 +395,7 @@
 	java_net_SocketAddress.h \
 	java_net_SocketImpl.h \
 	java_net_SocketOptions.h \
+	java_security_VMAccessController.h \
 	java_text_DateFormat.h \
 	java_util_Arrays.h \
 	java_util_Comparator.h \
Index: kaffe/libraries/clib/native/Makefile.am
diff -u kaffe/libraries/clib/native/Makefile.am:1.32 kaffe/libraries/clib/native/Makefile.am:1.33
--- kaffe/libraries/clib/native/Makefile.am:1.32	Thu Apr 22 09:22:38 2004
+++ kaffe/libraries/clib/native/Makefile.am	Mon May 31 21:15:18 2004
@@ -44,6 +44,9 @@
 		Field.c \
 		Method.c
 
+SECURITY_SRCS = \
+		AccessController.c
+
 TEXT_SRCS = \
 		DateFormat.c
 
@@ -62,6 +65,6 @@
 
 libnative_la_LIBADD = $(M_LIBS) $(LTLIBICONV)
 
-libnative_la_SOURCES = $(IO_SRCS) $(LANG_SRCS) $(REFLECT_SRCS) $(TEXT_SRCS) $(TEST_SRCS) $(UTIL_SRCS)
+libnative_la_SOURCES = $(IO_SRCS) $(LANG_SRCS) $(REFLECT_SRCS) $(SECURITY_SRCS) $(TEXT_SRCS) $(TEST_SRCS) $(UTIL_SRCS)
 
 CLEANFILES = so_locations
Index: kaffe/libraries/clib/native/Makefile.in
diff -u kaffe/libraries/clib/native/Makefile.in:1.135 kaffe/libraries/clib/native/Makefile.in:1.136
--- kaffe/libraries/clib/native/Makefile.in:1.135	Tue May 25 08:33:43 2004
+++ kaffe/libraries/clib/native/Makefile.in	Mon May 31 21:15:18 2004
@@ -84,17 +84,19 @@
 	Thread.lo ThreadStack.lo Throwable.lo UNIXProcess.lo \
 	ZipFile.lo
 am__objects_3 = Array.lo Constructor.lo Field.lo Method.lo
-am__objects_4 = DateFormat.lo
-am__objects_5 = TestNative.lo
-am__objects_6 = Arrays.lo TimeZone.lo
+am__objects_4 = AccessController.lo
+am__objects_5 = DateFormat.lo
+am__objects_6 = TestNative.lo
+am__objects_7 = Arrays.lo TimeZone.lo
 am_libnative_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
 	$(am__objects_3) $(am__objects_4) $(am__objects_5) \
-	$(am__objects_6)
+	$(am__objects_6) $(am__objects_7)
 libnative_la_OBJECTS = $(am_libnative_la_OBJECTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config -I$(top_builddir)/include/kaffe
 depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp
 am__depfiles_maybe = depfiles
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/Array.Plo ./$(DEPDIR)/Arrays.Plo \
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/AccessController.Plo \
+@AMDEP_TRUE@	./$(DEPDIR)/Array.Plo ./$(DEPDIR)/Arrays.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/ByteToCharDefault.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/ByteToCharIconv.Plo \
 @AMDEP_TRUE@	./$(DEPDIR)/CharToByteDefault.Plo \
@@ -398,6 +400,9 @@
 		Field.c \
 		Method.c
 
+SECURITY_SRCS = \
+		AccessController.c
+
 TEXT_SRCS = \
 		DateFormat.c
 
@@ -415,7 +420,7 @@
 	-export-symbols-regex "^([Jj]ava|kaffe)_"
 
 libnative_la_LIBADD = $(M_LIBS) $(LTLIBICONV)
-libnative_la_SOURCES = $(IO_SRCS) $(LANG_SRCS) $(REFLECT_SRCS) $(TEXT_SRCS) $(TEST_SRCS) $(UTIL_SRCS)
+libnative_la_SOURCES = $(IO_SRCS) $(LANG_SRCS) $(REFLECT_SRCS) $(SECURITY_SRCS) $(TEXT_SRCS) $(TEST_SRCS) $(UTIL_SRCS)
 CLEANFILES = so_locations
 all: all-am
 
@@ -486,6 +491,7 @@
 distclean-compile:
 	-rm -f *.tab.c
 
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AccessController.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Array.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Arrays.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ByteToCharDefault.Plo@am__quote@
Index: kaffe/libraries/javalib/Klasses.jar.bootstrap
cvs rdiff: failed to read diff file header /tmp/cvsSIheAH for Klasses.jar.bootstrap,v: end of file
system command returned non-zero exit status: 1: aborting