Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.6049 diff -u -r1.6049 ChangeLog --- ChangeLog 13 Jan 2006 14:30:27 -0000 1.6049 +++ ChangeLog 13 Jan 2006 14:33:56 -0000 @@ -1,3 +1,8 @@ +2006-01-13 Gary Benson + + * java/lang/System.java (setSecurityManager): Ensure policy + files are loaded before a security manager is put in place. + 2006-01-13 Mark Wielaard * configure.ac: Set version to 0.20. Index: java/lang/System.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/lang/System.java,v retrieving revision 1.53 diff -u -r1.53 System.java --- java/lang/System.java 13 Sep 2005 22:19:15 -0000 1.53 +++ java/lang/System.java 13 Jan 2006 14:33:56 -0000 @@ -178,6 +178,23 @@ if (SecurityManager.current != null) SecurityManager.current.checkPermission (new RuntimePermission("setSecurityManager")); + + // java.security.Security's class initialiser loads and parses the + // policy files. If it hasn't been run already it will be run + // during the first permission check. That initialisation will + // fail if a very restrictive security manager is in force, so we + // preload it here. + if (SecurityManager.current == null) + { + try + { + Class.forName("java.security.Security"); + } + catch (Throwable t) + { + } + } + SecurityManager.current = sm; }