[前][次][番号順一覧][スレッド一覧]

ruby-changes:57123

From: Hiroshi <ko1@a...>
Date: Sat, 17 Aug 2019 15:13:12 +0900 (JST)
Subject: [ruby-changes:57123] Hiroshi SHIBATA: 22d9bd944d (master): Keep the existance behavior with symlink path

https://git.ruby-lang.org/ruby.git/commit/?id=22d9bd944d

From 22d9bd944d4aae1b682e0bd4eafab706ff5a981e Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Sat, 17 Aug 2019 11:05:29 +0900
Subject: Keep the existance behavior with symlink path


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 https://github.com/ruby/ruby/blob/trunk/lib/rubygems/core_ext/kernel_require.rb#L39
     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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]