You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Nathan Beyer <nd...@apache.org> on 2008/08/23 19:12:32 UTC

[classlib] SimpleTimeZone and SecurityExceptions

There's a recurring failure in the
'tests.api.java.security.PermissionCollectionTest' test case that
seems to have begun when SimpleTimeZone began delegating functionality
to ICU's code. The exact failure is due to an ICU class, ICUDebug,
retrieving the property 'java.version' and not having permission to do
so. There are a few things we can do.

1. Change the test and add the permission to read 'java.version'
2. Wrap the lookup calls to ICU's TimeZone in PrivilegedAction
3. Attempt to get ICU to perform the property lookup with code to
handle the SecurityException

1 doesn't seem appropriate to me, but I'm not too familiar with the
test case. 2 seems appropriate, as SimpleTimeZone is part of the
privileged code base and this will just extend that. 3 may be
something we should do in addition to 2.

Thoughts, comments?

-Nathan

Re: [classlib] SimpleTimeZone and SecurityExceptions

Posted by Nathan Beyer <nd...@apache.org>.
BTW -
Scroll down on this test result page to see the stack trace of the
failure - http://people.apache.org/~chunrong/harmony-integrity/linux_x86/classlib-test/
I've also tested out implementing option 2, mentioned below, and the
test no longer fails.

On Sat, Aug 23, 2008 at 12:12 PM, Nathan Beyer <nd...@apache.org> wrote:
> There's a recurring failure in the
> 'tests.api.java.security.PermissionCollectionTest' test case that
> seems to have begun when SimpleTimeZone began delegating functionality
> to ICU's code. The exact failure is due to an ICU class, ICUDebug,
> retrieving the property 'java.version' and not having permission to do
> so. There are a few things we can do.
>
> 1. Change the test and add the permission to read 'java.version'
> 2. Wrap the lookup calls to ICU's TimeZone in PrivilegedAction
> 3. Attempt to get ICU to perform the property lookup with code to
> handle the SecurityException
>
> 1 doesn't seem appropriate to me, but I'm not too familiar with the
> test case. 2 seems appropriate, as SimpleTimeZone is part of the
> privileged code base and this will just extend that. 3 may be
> something we should do in addition to 2.
>
> Thoughts, comments?
>
> -Nathan
>

Re: [classlib] SimpleTimeZone and SecurityExceptions

Posted by Alexey Varlamov <al...@gmail.com>.
2008/8/24, Nathan Beyer <nd...@apache.org>:
> There's a recurring failure in the
> 'tests.api.java.security.PermissionCollectionTest' test case that
> seems to have begun when SimpleTimeZone began delegating functionality
> to ICU's code. The exact failure is due to an ICU class, ICUDebug,
> retrieving the property 'java.version' and not having permission to do
> so. There are a few things we can do.
>
> 1. Change the test and add the permission to read 'java.version'
> 2. Wrap the lookup calls to ICU's TimeZone in PrivilegedAction
> 3. Attempt to get ICU to perform the property lookup with code to
> handle the SecurityException
>
> 1 doesn't seem appropriate to me, but I'm not too familiar with the
> test case. 2 seems appropriate, as SimpleTimeZone is part of the
> privileged code base and this will just extend that. 3 may be
> something we should do in addition to 2.

The plan is good, just go for it. No point to fix the test as it
revealed a valid issue.
--
Alexey

>
> Thoughts, comments?
>
> -Nathan
>