This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: fix LogManager permission check
- From: Anthony Green <green at redhat dot com>
- To: classpath-patches <classpath-patches at gnu dot org>, java-patches at gcc dot gnu dot org
- Date: Fri, 06 Oct 2006 08:07:09 -0700
- Subject: Patch: fix LogManager permission check
I hit PR classpath/28070 again today (in FC5). I'd like to check this
patch into GNU Classpath, as well as GCC HEAD and the 4.1 branch. Ok?
AG
2006-10-06 Anthony Green <green@redhat.com>
PR classpath/28070:
* java/util/logging/LogManager.java: Don't share a control
permission object.
Index: java/util/logging/LogManager.java
===================================================================
RCS file: /sources/classpath/classpath/java/util/logging/LogManager.java,v
retrieving revision 1.24
diff -u -r1.24 LogManager.java
--- java/util/logging/LogManager.java 19 Sep 2006 10:41:45 -0000 1.24
+++ java/util/logging/LogManager.java 6 Oct 2006 15:02:49 -0000
@@ -787,13 +787,6 @@
}
/**
- * An instance of <code>LoggingPermission("control")</code>
- * that is shared between calls to <code>checkAccess()</code>.
- */
- private static final LoggingPermission controlPermission = new LoggingPermission("control",
- null);
-
- /**
* Checks whether the current security context allows changing
* the configuration of the logging framework. For the security
* context to be trusted, it has to be granted
@@ -807,7 +800,10 @@
{
SecurityManager sm = System.getSecurityManager();
if (sm != null)
- sm.checkPermission(controlPermission);
+ {
+ sm.checkPermission(new LoggingPermission("control",
+ null));
+ }
}
/**