harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ruth Cao" <ruoshe...@gmail.com>
Subject Re: [classlib][security]Harmony cannot parse some pathname symbols in policy file
Date Fri, 19 Jan 2007 12:31:17 GMT
2007/1/19, Stepan Mishura <stepan.mishura@gmail.com>:
>
> 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?


  Thanks,
> > Stepan.
> >
> > The problem is where should I add this method? Directly in
> > > DefaultPolicyParser? or some Util class else? Is there any security
> guy
> > > to
> > > give me some suggestion? Thanks in advance.
> > >
> > > --
> > > Best regards,
> > >
> > > Ruth Cao
> > > China Software Development Lab, IBM
> > >
> > >
> > --
> > Stepan Mishura
> > Intel Enterprise Solutions Software Division
>
>
>
>
> --
> Stepan Mishura
> Intel Enterprise Solutions Software Division
>
>


-- 
Best regards,

Ruth Cao
China Software Development Lab, IBM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message