Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 8140 invoked from network); 2 Mar 2009 07:28:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Mar 2009 07:28:34 -0000 Received: (qmail 15454 invoked by uid 500); 2 Mar 2009 07:28:33 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 15427 invoked by uid 500); 2 Mar 2009 07:28:33 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 15418 invoked by uid 99); 2 Mar 2009 07:28:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Mar 2009 23:28:33 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Mar 2009 07:28:33 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B26FF234C4A8 for ; Sun, 1 Mar 2009 23:28:12 -0800 (PST) Message-ID: <1652917109.1235978892729.JavaMail.jira@brutus> Date: Sun, 1 Mar 2009 23:28:12 -0800 (PST) From: "Regis Xu (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-6106) [classlib][security] PolicyUtils.expandURL may return invalid URL on linux In-Reply-To: <1288441791.1235977932815.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-6106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Regis Xu updated HARMONY-6106: ------------------------------ Attachment: HARMONY-6106.diff Would anyone want to try this? > [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.