You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tim Ellison (JIRA)" <ji...@apache.org> on 2006/03/30 17:02:26 UTC

[jira] Resolved: (HARMONY-280) Customized SecurityManager cannot cooperate with AccessController correctly

     [ http://issues.apache.org/jira/browse/HARMONY-280?page=all ]
     
Tim Ellison resolved HARMONY-280:
---------------------------------

    Resolution: Duplicate

Duplicate of HARMONY-121

> Customized SecurityManager cannot cooperate with AccessController correctly
> ---------------------------------------------------------------------------
>
>          Key: HARMONY-280
>          URL: http://issues.apache.org/jira/browse/HARMONY-280
>      Project: Harmony
>         Type: Bug
>   Components: Classlib
>     Reporter: Paulex Yang
>     Priority: Critical

>
> when user set a customized SecurityManager, which extends java.lang.SecurityManager,  as the system-wide security manager, any security check fails in a stack overflow.  This issue only happens when customized SecurityManager isn't located in bootstrap classpath.
> Following testcases reproduce this problem (suppose the test has permission to set securitymanager):
> public class securityTest extends TestCase {
>     public void test_MockSecurityManager() throws Exception {
>         SecurityManager old = System.getSecurityManager();
>         System.setSecurityManager(new MockSecurityManager());
>         try {
>               System.getProperty("os.name");
>         } catch (SecurityException e) {
>         } finally {
>             System.setSecurityManager(old);
>         }
>     }
>     public class MockSecurityManager extends SecurityManager {
>         public void checkPermission(Permission perm) {
>             if (perm.getName().equals("setSecurityManager")) {
>                 return;
>             }
>             super.checkPermission(perm);
>         }
>     }
> }
> test runs smoothly on RI 5.0 , but fails with a StackOverflowError on Harmony

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Re: [jira] Resolved: (HARMONY-280) Customized SecurityManager cannot cooperate with AccessController correctly

Posted by Tim Ellison <t....@gmail.com>.
Richard Liang wrote:
> I notice that Mikhail had provided the patch for Harmony-121 and we have
> some test cases about nio channels depending on the fix, would you
> please apply the patch for Harmony-121? Thanks a lot.

You can bug Mikhail directly now ;-)

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Re: [jira] Resolved: (HARMONY-280) Customized SecurityManager cannot cooperate with AccessController correctly

Posted by Richard Liang <ri...@gmail.com>.
Tim Ellison (JIRA) wrote:
>      [ http://issues.apache.org/jira/browse/HARMONY-280?page=all ]
>      
> Tim Ellison resolved HARMONY-280:
> ---------------------------------
>
>     Resolution: Duplicate
>
> Duplicate of HARMONY-121
>
>   
>> Customized SecurityManager cannot cooperate with AccessController correctly
>> ---------------------------------------------------------------------------
>>
>>          Key: HARMONY-280
>>          URL: http://issues.apache.org/jira/browse/HARMONY-280
>>      Project: Harmony
>>         Type: Bug
>>   Components: Classlib
>>     Reporter: Paulex Yang
>>     Priority: Critical
>>     
>
>   
>> when user set a customized SecurityManager, which extends java.lang.SecurityManager,  as the system-wide security manager, any security check fails in a stack overflow.  This issue only happens when customized SecurityManager isn't located in bootstrap classpath.
>> Following testcases reproduce this problem (suppose the test has permission to set securitymanager):
>> public class securityTest extends TestCase {
>>     public void test_MockSecurityManager() throws Exception {
>>         SecurityManager old = System.getSecurityManager();
>>         System.setSecurityManager(new MockSecurityManager());
>>         try {
>>               System.getProperty("os.name");
>>         } catch (SecurityException e) {
>>         } finally {
>>             System.setSecurityManager(old);
>>         }
>>     }
>>     public class MockSecurityManager extends SecurityManager {
>>         public void checkPermission(Permission perm) {
>>             if (perm.getName().equals("setSecurityManager")) {
>>                 return;
>>             }
>>             super.checkPermission(perm);
>>         }
>>     }
>> }
>> test runs smoothly on RI 5.0 , but fails with a StackOverflowError on Harmony
>>     
>
>   
Hello Tim,

I notice that Mikhail had provided the patch for Harmony-121 and we have 
some test cases about nio channels depending on the fix, would you 
please apply the patch for Harmony-121? Thanks a lot.

-- 
Richard Liang
China Software Development Lab, IBM