From: Andrew Haley Date: Mon, 29 Jan 2007 13:43:22 +0000 (+0000) Subject: SecurityManager.java: Load and initialize java.security.Security. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ff5157e57978d68c74437841651937e08ae45b98;p=gcc.git SecurityManager.java: Load and initialize java.security.Security. 2007-01-26 Andrew Haley * java/lang/SecurityManager.java: Load and initialize java.security.Security. From-SVN: r121287 --- diff --git a/libjava/classpath/java/lang/SecurityManager.java b/libjava/classpath/java/lang/SecurityManager.java index 61b4612b1aa..ff84d950608 100644 --- a/libjava/classpath/java/lang/SecurityManager.java +++ b/libjava/classpath/java/lang/SecurityManager.java @@ -167,6 +167,18 @@ public class SecurityManager */ public SecurityManager() { + /* "When there is security manager installed, the security manager + need to check the package access. However, if the security + manager itself uses any unloaded class, it will trigger the + classloading, which causes infinite loop. There is no easy + legal solution. The workaround will be that security manager + can not depend on any unloaded class. In the constructor of + security manager, it must transitively load all classes it + refers to." Sun bug #4242924. */ + + // Load and initialize java.security.Security + java.security.Security.getProvider((String)null); + SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(new RuntimePermission("createSecurityManager")); diff --git a/libjava/classpath/lib/java/lang/SecurityManager.class b/libjava/classpath/lib/java/lang/SecurityManager.class index c8c93029712..7f080b51604 100644 Binary files a/libjava/classpath/lib/java/lang/SecurityManager.class and b/libjava/classpath/lib/java/lang/SecurityManager.class differ