Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.5, JRuby 1.7.0.pre1
-
Fix Version/s: JRuby 1.6.6, JRuby 1.7.0.pre1
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:OS X 10.7.2
-
Number of attachments :
Description
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:
private String expandRelativeJarPath(String path) {
return path.replaceAll("/[^/]+/\\.\\.|[^/]+/\\.\\./|\\./","").replace("^\\\\","/");
}
This passes all existing tests and fixes the problem. I can add a test and submit a patch if desired.
Attached patch with fix.