[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cp-patches] FYI: Patch
From: |
Jeroen Frijters |
Subject: |
RE: [cp-patches] FYI: Patch |
Date: |
Mon, 11 Oct 2004 16:35:53 +0200 |
Michael Koch wrote:
> 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 ?
Because that only support System properties, this is a Security
property.
Regards,
Jeroen