summaryrefslogtreecommitdiff
path: root/lib/rubygems/core_ext
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-11-12 08:03:26 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-11-12 08:03:26 +0900
commitd9978ce5d397866afae536db2aa708af3b7a4b2f (patch)
treea49d8e7a230927685e65154f22850aac579c3a3b /lib/rubygems/core_ext
parentb8d242d221641752a495ca43f8f211a3ad73d467 (diff)
Use untaint for File.symlink in kernel_require.rb
Partly reverted 7d463e360b9c4718b17378eb52783116a01b884b
Diffstat (limited to 'lib/rubygems/core_ext')
-rw-r--r--lib/rubygems/core_ext/kernel_require.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb
index 944bb93..ae0254b 100644
--- a/lib/rubygems/core_ext/kernel_require.rb
+++ b/lib/rubygems/core_ext/kernel_require.rb
@@ -41,7 +41,10 @@ module Kernel
resolved_path = begin
rp = nil
$LOAD_PATH[0...Gem.load_path_insert_index || -1].each do |lp|
- safe_lp = lp.dup.tap(&Gem::UNTAINT)
+ # TODO:
+ # for test_require.rb of ruby core test suite
+ # We should use Gem::UNTAINT after https://bugs.ruby-lang.org/issues/16131
+ safe_lp = lp.dup.untaint
begin
if File.symlink? safe_lp # for backword compatibility
next