Hi,

I checked in the attached patch.

Regards,
Jeroen

2005-01-13  Jeroen Frijters  <[EMAIL PROTECTED]>

        * java/security/Security.java
        (getProperty): Added hack to skip security check when trusted
        code is direct caller.
Index: java/security/Security.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/security/Security.java,v
retrieving revision 1.39
diff -u -r1.39 Security.java
--- java/security/Security.java 3 Jan 2006 10:06:11 -0000       1.39
+++ java/security/Security.java 13 Jan 2006 06:52:05 -0000
@@ -1,5 +1,6 @@
 /* Security.java --- Java base security class implementation
-   Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005  Free Software Foundation, 
Inc.
+   Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -41,6 +42,7 @@
 import gnu.classpath.SystemProperties;
 
 import gnu.classpath.Configuration;
+import gnu.classpath.VMStackWalker;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -391,8 +393,11 @@
    */
   public static String getProperty(String key)
   {
+    // XXX To prevent infinite recursion when the SecurityManager calls us,
+    // don't do a security check if the caller is trusted (by virtue of having
+    // been loaded by the bootstrap class loader).
     SecurityManager sm = System.getSecurityManager();
-    if (sm != null)
+    if (sm != null && VMStackWalker.getCallingClassLoader() != null)
       sm.checkSecurityAccess("getProperty." + key);
 
     return secprops.getProperty(key);
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to