summaryrefslogtreecommitdiff
path: root/lib/rubygems/core_ext
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-17 11:05:29 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-17 15:12:45 +0900
commit22d9bd944d4aae1b682e0bd4eafab706ff5a981e (patch)
treedebe2f10ca94701cf879accf37f66ec18bb39953 /lib/rubygems/core_ext
parent273f1f44982475f8c93805c9b9ec604846f3a5de (diff)
Keep the existance behavior with symlink path
Diffstat (limited to 'lib/rubygems/core_ext')
-rwxr-xr-xlib/rubygems/core_ext/kernel_require.rb4
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 5986e35..cbd9258 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