gcjwebplugin-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcjwebplugin-devel] [patch] Handle more SecurityHandler requests


From: Petter Reinholdtsen
Subject: [Gcjwebplugin-devel] [patch] Handle more SecurityHandler requests
Date: Wed, 05 Apr 2006 16:05:10 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (usg-unix-v)

I did a test run with the security handler enabled, and discovered a
few more requests which should be handled/accepted by the handler.

Here is a patch relative to current CVS to allow these.  Please
include in the next release of gcjwebplugin.

Index: AppletSecurityManager.java
===================================================================
RCS file: 
/sources/gcjwebplugin/gcjwebplugin/src/gnu/gcjwebplugin/AppletSecurityManager.java,v
retrieving revision 1.4
diff -u -3 -p -u -r1.4 AppletSecurityManager.java
--- AppletSecurityManager.java  5 Apr 2004 20:10:47 -0000       1.4
+++ AppletSecurityManager.java  5 Apr 2006 13:49:05 -0000
@@ -25,6 +25,10 @@ import java.net.SocketPermission;
 import java.security.Permission;
 import java.security.SecurityPermission;
 import java.util.PropertyPermission;
+import java.net.NetPermission;
+import java.lang.reflect.ReflectPermission;
+import java.awt.AWTPermission;
+import java.util.logging.LoggingPermission;
 
 
 class AppletSecurityManager extends SecurityManager
@@ -57,8 +76,12 @@ class AppletSecurityManager extends Secu
       return;
     
     // Needed to allow to access AWT event queue.
-    if (permission.getName().equals("accessEventQueue"))
-      return;
+    if (permission instanceof AWTPermission) {
+      if (permission.getName().equals("accessEventQueue"))
+        return;
+      if (permission.getName().equals("replaceKeyboardFocusManager"))
+        return;
+    }
     
     // Needed to create a class loader for each codebase.
     if (permission.getName().equals("createClassLoader"))
@@ -66,6 +89,15 @@ class AppletSecurityManager extends Secu
 
     // FIXME: we need to allow access to codebase here.
 
+    if (permission instanceof ReflectPermission)
+      return;
+
+    if (permission instanceof LoggingPermission)
+      return;
+
+    if (permission instanceof NetPermission) // for URL loading
+      return;
+
     if (permission instanceof SocketPermission      // for net access
        || permission instanceof RuntimePermission) // for 
checkWrite(FileDescriptor)
       return;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]