harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Catherine Hope (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-6495) [java6][classlib][luni] File.canExecute throws SecurityException when file doesn't have read permission
Date Wed, 07 Apr 2010 13:55:33 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-6495?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Catherine Hope updated HARMONY-6495:

    Attachment: 6495.patch

Patch is for Java 6 tree.  It inlines the exists method functionality into canExecute but
without the security check for read permission.  The testcase demonstrates the problem and
also checks security exceptions from the other methods.

> [java6][classlib][luni] File.canExecute throws SecurityException when file doesn't have
read permission
> -------------------------------------------------------------------------------------------------------
>                 Key: HARMONY-6495
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6495
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 6.0M1
>            Reporter: Catherine Hope
>         Attachments: 6495.patch
> Executing file.canExecute with a security policy that grants the file execute permission
throws a security exception that the file does not have read permission:
> java.security.AccessControlException: Access denied (java.io.FilePermission /tmp/harmony-test-FileTest/executeFile
> 	at java.security.AccessController.checkPermission(AccessController.java:95)
> 	at java.lang.SecurityManager.checkPermission(SecurityManager.java:862)
> 	at java.lang.SecurityManager.checkRead(SecurityManager.java:480)
> 	at java.io.File.exists(File.java:446)
> 	at java.io.File.canExecute(File.java:1702)
> According to the spec, a security exception should be thrown only when SecurityManager.checkExec
denies access.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message