diff options
author | Jeroen Frijters <jeroen@sumatra.nl> | 2006-01-13 07:56:36 +0000 |
---|---|---|
committer | Jeroen Frijters <jeroen@sumatra.nl> | 2006-01-13 07:56:36 +0000 |
commit | 7a8e146b025408f47bc5ba575a5d9fa52e5030b4 (patch) | |
tree | c75b5a03e75f046f186d766c27708c9d939a05a6 /java/security | |
parent | e389026b0d467bf559037be1a021b0c308cabdea (diff) | |
download | classpath-7a8e146b025408f47bc5ba575a5d9fa52e5030b4.tar.gz |
2005-01-13 Jeroen Frijters <jeroen@frijters.net>
* java/security/Security.java
(getProperty): Added hack to skip security check when trusted
code is direct caller.
Diffstat (limited to 'java/security')
-rw-r--r-- | java/security/Security.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/java/security/Security.java b/java/security/Security.java index 6493bab4e..d26d049c5 100644 --- a/java/security/Security.java +++ b/java/security/Security.java @@ -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 @@ package java.security; 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 final class Security */ 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); |