[OpenJDK 2D-Dev] [PATCH] Request for review: 6904882: java.awt.Font.createFont() causes AccessControlException if executed with "-Djava.security.manager"

Phil Race Phil.Race at Sun.COM
Wed Feb 3 19:55:38 UTC 2010


looks fine.

-phil

On 2/3/2010 11:35 AM, Roman Kennke wrote:
> I moved the FontPrivilege test into open. I did one small change to it,
> instead of calling setSecurityManager() in the beginning of the test, I
> added the tag /security=java.lang.SecurityManager which should have
> about the same effect.
>
> http://cr.openjdk.java.net/~rkennke/6904882/webrev.02/
>
> Is this ok to push?
>
> Also needs one more review, Igor, Dmitri, anyone else left in 2d?
>
> /Roman
>
> Am Montag, den 30.11.2009, 11:49 -0800 schrieb Phil Race:
>> Like the last one, this could use a regression test - even though
>> there's a JCK failure. FWIW a trivial one like this :-
>>
>> import java.awt.*;
>> import java.io.File;
>>
>> public class CreateFontSMTest {
>>       public static void main(String[] args) throws Exception {
>>           System.setSecurityManager(new SecurityManager());
>>           Font font = new Font("Dialog", Font.PLAIN, 12);
>>           System.out.println(font.getFontName());
>>       }
>> }
>>
>> will work, but I also found we already have a test .. which I
>> guess never got run :-(, called FontPrivilege.java that does
>> something very similar. Its also in closed and I leave it
>> up to you whether to open that or add a new one but opening
>> it would be best.
>>
>> -phil.
>>
>>
>>
>> Roman Kennke wrote:
>>> This patches fixes bug #6904882. As suggested by Phil it puts the whole
>>> static initializer in a privileged block, grouping the existing 4
>>> smaller blocks into one, and importantly including the offending
>>> File.exists() call. This requires to make the static fields non-final.
>>>
>>> http://cr.openjdk.java.net/~rkennke/6904882/webrev.00/
>>>
>>> Ok to commit?
>>>
>>> /Roman
>>>
>>>
>
>



More information about the 2d-dev mailing list