harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Ellison (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-4754) [classlib] FilePermission incorrect canonical path
Date Fri, 07 Sep 2007 19:32:30 GMT

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

Tim Ellison commented on HARMONY-4754:
--------------------------------------

Ok, now if I create the directory "foobartest/" in the cwd, and then touch the file "-" in
that directory, when I run the same snippet 

    new FilePermission("foobartest/-", "read") 

on RI / Harmony I see (edited for brevity) :

DIRECTORY ...\Tim test\            SUCCESS FileBothDirectoryInformation: foobartest
OPEN      ...\Tim test\foobartest\ SUCCESS Options: Open Directory Access: 00100001
DIRECTORY ...\Tim test\foobartest\ SUCCESS FileBothDirectoryInformation: -
CLOSE     ...\Tim test\foobartest\ SUCCESS

i.e. the RI and harmony both stat the file called "-", even though it is not intended to represent
an actual file, just the foobartest directory recursively.

Are you saying that you don't see that stat?  I'm just trying to figure out where the difference
lies, whether it is in fact in the constructor or in the implementation of #implies.

Thanks

> [classlib] FilePermission incorrect canonical path
> --------------------------------------------------
>
>                 Key: HARMONY-4754
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4754
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Mark Hindess
>            Assignee: Tim Ellison
>
> If called with a path ending in "-" or "*", java.io.FilePermission calls  File.getCanonicalPath
with the "-" or "*" still appended.  This is incorrect (and produces very odd results if "-"
or "*" exists - perhaps as a symlink to some completely different tree).
> For example, if you do:
>   mkdir test
>   ln -s /tmp test/-
>  then (new FilePermission("test/-", "read")).implies(new FilePermission("/tmp/file",
"read")
> is true and (new FilePermission("test/-", "read")).implies(new FilePermission("test/file",
"read") is false where as on the RI it is the opposite way around since the '-' symlink is
(correctly) ignored.

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


Mime
View raw message