harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Markov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-2955) [classlib][luni]File.deleteOnExit should implement with doPrivileged?
Date Wed, 10 Jan 2007 16:57:28 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-2955?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463628
] 

Mikhail Markov commented on HARMONY-2955:
-----------------------------------------

Hi Tony,
I could guess that Eclipse explicitly calls System.setSecurityManager(null); prior to calling
this code (or somehow otherwise call System.setSecurityManager() method) - it seems that the
root cause (for RI) is static initializer somewhere in this method which conflicts with user-defined
classes.

Also, I've opened the discussion on dev-mail list here: http://mail-archives.apache.org/mod_mbox/harmony-dev/200701.mbox/%3c51abf0750701100133q5897365dkc27f707b3290753@mail.gmail.com%3e


> [classlib][luni]File.deleteOnExit should implement with doPrivileged?
> ---------------------------------------------------------------------
>
>                 Key: HARMONY-2955
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2955
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Tony Wu
>
> As title, following testcase passes on RI whereas throws "AccessControlException:Access
denied" on Harmony
>     public void test() throws IOException {
>         File dir = File.createTempFile("hytemp", "");
>         dir.deleteOnExit();
>         SecurityManager backup = System.getSecurityManager();
>         try {
>             System.setSecurityManager(new MySecurityManager());
>         } finally {
>             System.setSecurityManager(backup);
>         }
>     }
>     class MySecurityManager extends SecurityManager {
>         public void checkPermission(Permission perm) {
>             if ("setSecurityManager".equals(perm.getName())) {
>                 return;
>             }
>             super.checkPermission(perm);
>         }
>     }

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

        

Mime
View raw message