When canonicalizing classpath URIs, use a bogus root path.#4543
Merged
headius merged 1 commit intojruby:masterfrom Mar 24, 2017
Merged
When canonicalizing classpath URIs, use a bogus root path.#4543headius merged 1 commit intojruby:masterfrom
headius merged 1 commit intojruby:masterfrom
Conversation
This prevents in-classloader paths from expanding using real filesystem paths that may resolve symlinks. Fixes jruby#4145.
|
|
||
| if (classloaderURI) { | ||
| String fakePrefix = "/THIS_IS_A_FAKE_PATH_FOR_JRUBY"; | ||
| relativePath = canonicalizePath(fakePrefix + "/" + relativePath).substring(fakePrefix.length()); |
There was a problem hiding this comment.
@headius this ends up being off by two characters on Windows because the canonicalized path will begin with C:. So you end up with classpath:BY\yourpathhere.rb. Sorry I couldn't test ahead of time.
This was referenced Jun 6, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This prevents in-classloader paths from expanding using real
filesystem paths that may resolve symlinks.
Fixes #4145.