Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 99715 invoked from network); 22 Jan 2007 10:56:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Jan 2007 10:56:17 -0000 Received: (qmail 8748 invoked by uid 500); 22 Jan 2007 10:56:21 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 8709 invoked by uid 500); 22 Jan 2007 10:56:21 -0000 Mailing-List: contact dev-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 dev@harmony.apache.org Received: (qmail 8700 invoked by uid 99); 22 Jan 2007 10:56:21 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jan 2007 02:56:20 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of ruoshen.c@gmail.com designates 64.233.162.235 as permitted sender) Received: from [64.233.162.235] (HELO nz-out-0506.google.com) (64.233.162.235) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jan 2007 02:56:12 -0800 Received: by nz-out-0506.google.com with SMTP id j2so872273nzf for ; Mon, 22 Jan 2007 02:55:51 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=XonrB9Zlo29vMtvseYqsTl22eL+wihqxJajlgaAcAUsH2nqEO7gAOfRU86Y5ZP4cII3ib4mWDnwArUTZYK5C2+F8dOs7XgDO73rev0xCSnjxIC7q2Dyo8KVy9huzAWtgFK0jitqOPO4IXKpCZ96wAtFkrLlpsmreWWVC8ECglsw= Received: by 10.35.93.19 with SMTP id v19mr10183933pyl.1169463351287; Mon, 22 Jan 2007 02:55:51 -0800 (PST) Received: by 10.35.70.11 with HTTP; Mon, 22 Jan 2007 02:55:51 -0800 (PST) Message-ID: <843dd4f00701220255m1dec0794l4db623a2887bec8b@mail.gmail.com> Date: Mon, 22 Jan 2007 18:55:51 +0800 From: "Ruth Cao" To: dev@harmony.apache.org Subject: Re: [classlib][security]Harmony cannot parse some pathname symbols in policy file In-Reply-To: <6e47b64f0701212048y48d7c038p6a2a7222b2ca7d5b@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_127590_25154941.1169463351250" References: <843dd4f00701182003o20efe42bof4f16774de0f1eea@mail.gmail.com> <6e47b64f0701182202s1ab2662al91ee0b37730ae4c2@mail.gmail.com> <6e47b64f0701182223j77dc1817h47644f1a39fe124c@mail.gmail.com> <843dd4f00701190431w1bb22b92h3c27694ae5355c1b@mail.gmail.com> <6e47b64f0701212048y48d7c038p6a2a7222b2ca7d5b@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_127590_25154941.1169463351250 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 2007/1/22, Stepan Mishura : > > On 1/19/07, Ruth Cao wrote: > > > > 2007/1/19, Stepan Mishura: > > > > > > On 1/19/07, Stepan Mishura wrote: > > > > > > > > On 1/19/07, Ruth Cao wrote: > > > > > > > > > > Hi all, > > > > > > > > > > When working on HARMONY-2910, we've found that current Harmony > code > > > does > > > > > not > > > > > support relative pathname symbols (such as '.', '..', etc.) in > > policy > > > > > file. > > > > > > > > > > Details can be found at > > > > > http://issues.apache.org/jira/browse/HARMONY-2910 > > > > > > > > > > I think it may be feasible to add a method to convert the URL > > location > > > > > of > > > > > CodeSource into 'standard' forms (which has no '.', '..' but has > the > > > > > same > > > > > meaning). > > > > > > > > > > > > Hi Ruth, > > > > > > > > I assume that relative path name symbols may be used in other > modules. > > > So > > > > why we have to add a method for URL converting to 'security' module > > not > > > to > > > > 'luni'? > > > > IOW, is this issue specific for security code only? > > > > > > > > > > > > > > I reread my post and I want to clarify what I meant: I think that we > > > should > > > add this method to 'luni' util class because I assume that this > > > functionality may be used not only by 'security' module. > > > > > > I'm afraid it is... Both RI and Harmony does not parse these symbols in > > the > > URL class. Both of them passed the following test case: > > > > public class URLTest extends{ > > public void test_pathname() throws Exception { > > URL url1 = new URL("file:/home/../home/1.txt"); > > assertEquals("/home/../home/1.txt", url1.getFile()); > > URL url2 = new URL("file:/home/1.txt"); > > assertEquals("/home/1.txt", url2.getFile()); > > assertFalse(url1.equals(url2)); > > } > > } > > > > Thus, perhaps it is a good choice to add a method such as > > PolicyUtils.normalizeURL(String url). Any comments? > > > Can URI >.*normalize*() > functionality be used for this case? Thank you very much for your advice, Stepan. I've tried this method successfully. Besides, it seems that Harmony does not support these symbols in Policy.getPermission(CodeSource) when the param contains them. I'll upload a new patch and include the fix mentioned above. Thanks, > Stepan Mishura > Intel Enterprise Solutions Software Division > > -- Best regards, Ruth Cao China Software Development Lab, IBM ------=_Part_127590_25154941.1169463351250--