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


Reply via email to