diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-08-17 11:05:29 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-08-17 15:12:45 +0900 |
commit | 22d9bd944d4aae1b682e0bd4eafab706ff5a981e (patch) | |
tree | debe2f10ca94701cf879accf37f66ec18bb39953 /lib/rubygems | |
parent | 273f1f44982475f8c93805c9b9ec604846f3a5de (diff) | |
download | ruby-22d9bd944d4aae1b682e0bd4eafab706ff5a981e.tar.gz |
Keep the existance behavior with symlink path
Diffstat (limited to 'lib/rubygems')
-rwxr-xr-x | lib/rubygems/core_ext/kernel_require.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb index 5986e356bc..cbd92588c0 100755 --- a/lib/rubygems/core_ext/kernel_require.rb +++ b/lib/rubygems/core_ext/kernel_require.rb @@ -39,8 +39,10 @@ module Kernel resolved_path = begin rp = nil $LOAD_PATH[0...Gem.load_path_insert_index || -1].each do |lp| + safe_lp = lp.dup.untaint + next if File.symlink? safe_lp Gem.suffixes.each do |s| - full_path = File.expand_path(File.join(lp, "#{path}#{s}").untaint) + full_path = File.expand_path(File.join(safe_lp, "#{path}#{s}")) if File.file?(full_path) rp = full_path break |