[Top][All Lists]
[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 17:00:25 +0200 |
User-agent: |
KMail/1.6.2 |
Am Montag, 11. Oktober 2004 16:35 schrieb Jeroen Frijters:
> 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.
Right, I totally overlooked this. Wouldn't it be good to introduce
GetSecurityPropertyAction for this ?
Michael
--
Homepage: http://www.worldforge.org/