I have attached a patch with a fix and a patch with a test to this issue, but 
the test only fails when run alone.

It seems the class path is not isolated when running multiple load tests.  I 
tried setting the class loader of the ScriptingContainer to 
ClassLoader.getSystemClassLoader, but it made no difference.

Anybody know a way to ensure a clean class path when starting a scripting 
container in our tests?



On 2011-11-01, at 13:18, Uwe Kubosch (JIRA) wrote:

> Requiring a file from a JAR that has a path inside the JAR that coincides 
> with a path on the file system that includes a symlink fails
> --------------------------------------------------------------------------------------------------------------------------------------
> 
>                 Key: JRUBY-6172
>                 URL: https://jira.codehaus.org/browse/JRUBY-6172
>             Project: JRuby
>          Issue Type: Bug
>          Components: Core Classes/Modules
>    Affects Versions: JRuby 1.6.5, JRuby 1.7
>         Environment: OS X 10.7.2
>            Reporter: Uwe Kubosch
>             Fix For: JRuby 1.6.6, JRuby 1.7
> 
> 
> It all boils down to org.jruby.runtime.load.LoadService#expandRelativeJarPath 
> using File#getCanonicalPath to expand the JAR entry path.  A quick fix is to 
> change expandRelativeJarPath like this:
> 
> {noformat}
>    private String expandRelativeJarPath(String path) {
>        return 
> path.replaceAll("/[^/]+/\\.\\.|[^/]+/\\.\\./|\\./","").replace("^\\\\","/");
>    }
> {noformat}
> 
> This passes all existing tests and fixes the problem.  I can add a test and 
> submit a patch if desired.
> 
> 
> --
> This message is automatically generated by JIRA.
> For more information on JIRA, see: http://www.atlassian.com/software/jira
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>    http://xircles.codehaus.org/manage_email
> 
> 

--
Uwe Kubosch
u...@kubosch.no
http://kubosch.no/







---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to