classpath-patches
[Top][All Lists]
Advanced

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

Re: [cp-patches] FYI: Patch


From: Michael Koch
Subject: Re: [cp-patches] FYI: Patch
Date: Mon, 11 Oct 2004 16:36:29 +0200
User-agent: KMail/1.6.2

Am Montag, 11. Oktober 2004 15:20 schrieb Jeroen Frijters:
> Hi,
>
> I committed the attached patch to wrap getting the security and
> system properties in an AccessController.doPrivileged() call.

@@ -1013,12 +1014,16 @@
    * @see #checkPackageAccess(String)
    * @see #checkPackageDefinition(String)
    */
-  void checkPackageList(String packageName, String restriction,
+  void checkPackageList(String packageName, final String restriction,
                         String permission)
   {
     // Use the toString() hack to do the null check.
     Permission p = new RuntimePermission(permission + 
packageName.toString());
-    String list = Security.getProperty("package." + restriction);
+    String list = (String)AccessController.doPrivileged(new 
PrivilegedAction() {
+ public Object run() {
+     return Security.getProperty("package." + restriction);
+ }
+    });
     if (list == null)
       return;
     while (! "".equals(packageName))

Why not use "GetPropertyAction" here ?


Michael
-- 
Homepage: http://www.worldforge.org/




reply via email to

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