You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey Varlamov (JIRA)" <ji...@apache.org> on 2009/03/03 14:18:56 UTC

[jira] Commented: (HARMONY-6106) [classlib][security] PolicyUtils.expandURL may return invalid URL on linux

    [ https://issues.apache.org/jira/browse/HARMONY-6106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678311#action_12678311 ] 

Alexey Varlamov commented on HARMONY-6106:
------------------------------------------

Hmm, unsure how this complies with syntactic guidelines for a policy file. Just curious, how RI behaves here?

> [classlib][security] PolicyUtils.expandURL may return invalid URL on linux
> --------------------------------------------------------------------------
>
>                 Key: HARMONY-6106
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6106
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Regis Xu
>             Fix For: 5.0M9
>
>         Attachments: HARMONY-6106.diff
>
>
> the test:
>         Properties props = new Properties();
>         props.put("my.home", "/home/bahamut");
>         String location = PolicyUtils.expandURL("file:/${my.home}/test", props);
>         URL url = new URL(location);
>         System.out.println(url.getHost());
>         System.out.println(url.getPath());
>         System.out.println(url.toString());
> output is:
> home
> /bahamut/test
> file://home/bahamut/test
> the expanded URL is "file://home/bahamut/test", but what we want is "file:/home/bahamut/test", 
> the one extra "/" make host of URL to be "home" which should be "", and then url.openConnection(), 
> the wrong URL will use ftp protocol to open the file.

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