harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James M Snell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-1596) AccessController.doPrivileged(PrivilegedAction,AccessControllerContext) does not use the passed in AccessControllerContext
Date Wed, 27 Sep 2006 04:17:56 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-1596?page=comments#action_12438017 ] 
            
James M Snell commented on HARMONY-1596:
----------------------------------------

The problem is actually in the Java code.  If you look at the doPrivileged(PrivilegedAction,AccessControlContext)
method [1] you'll see that the passed in context is not being used at all.  The passed in
context is simply ignored and the privileged action is executed within the calling context.
 However, FWIW, I'm running the J9 JVM.

[1] http://tinyurl.com/h9flh

public static <T> T doPrivileged(
  PrivilegedAction<T> action,
  AccessControlContext context) {
    T result = action.run();
    keepalive(context);
    return result;
}


> AccessController.doPrivileged(PrivilegedAction,AccessControllerContext) does not use
the passed in AccessControllerContext
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1596
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1596
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Linux
>            Reporter: James M Snell
>
> When calling doPrivleged with a provided AccessControllerContext, the passed in context
is never used to check permissions against. 
> There is a simple way to test.
> System.setSecurityManager(new SecurityManager());
> ProtectionDomain domain = new MyCustomProtectionDomain(); // programmed to always return
true
> AccessControlContext acc = new AccessControlContext(new ProtectionDomain[] {domain});
> PrivilegedAction action = new PrivilegedAction() {
>   public Object run() {
>     File file = new File("/tmp");
>     file.exists();
>   }
> }
> AccessController.doPrivileged(action, acc);
> The passed in acc will never be used

-- 
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

        

Mime
View raw message