harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Beyer" <ndbe...@apache.org>
Subject Re: doPrivileged needed on many loadLibrary calls?
Date Thu, 07 Aug 2008 02:23:32 GMT
Seems reasonable, especially for the non-'java.*' code. I'd replace the
PrivilegedAction type variable 'Object' with 'Void'.

Post some patches to JIRA.

-Nathan

On Wed, Aug 6, 2008 at 3:59 PM, Andrew Cornwall <andrew.pack200@gmail.com>wrote:

> I've been looking through the Harmony code and have run into a number of
> cases where loadLibrary() is called without recourse to an
> AccessController.doPrivileged() operation. It seems as if a number of
> places
> just get lucky with the security manager. Is there any reason not to
> replace:
>
>    static {
>        System.loadLibrary("hyfoo"); //$NON-NLS-1$
>    }
>
> with:
>
>    static {
>            AccessController.doPrivileged(new PrivilegedAction<Object>() {
>                public Object run() {
>                    System.loadLibrary("hyfoo"); //$NON-NLS-1$
>                    return null;
>                }
>            });
>    }
>
> Some of the files are in java.* packages, so they have to be on the
> bootpath
> - which means wrapping them might not make sense. But others (like
> PSPrinterJob and RandomBitsSupplier) are in org.apache.harmony.*, and might
> not necessarily be on the bootpath for all consumers of Harmony classes.
>
> Any thoughts?
>
>    Andrew Jr.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message