diff options
Diffstat (limited to 'lib/rubygems/core_ext')
-rw-r--r-- | lib/rubygems/core_ext/kernel_require.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/rubygems/core_ext/kernel_require.rb b/lib/rubygems/core_ext/kernel_require.rb index 88b1bd9cd6..944bb93bb6 100644 --- a/lib/rubygems/core_ext/kernel_require.rb +++ b/lib/rubygems/core_ext/kernel_require.rb @@ -42,7 +42,15 @@ module Kernel rp = nil $LOAD_PATH[0...Gem.load_path_insert_index || -1].each do |lp| safe_lp = lp.dup.tap(&Gem::UNTAINT) - next if File.symlink? safe_lp # for backword compatibility + begin + if File.symlink? safe_lp # for backword compatibility + next + end + rescue SecurityError + RUBYGEMS_ACTIVATION_MONITOR.exit + raise + end + Gem.suffixes.each do |s| full_path = File.expand_path(File.join(safe_lp, "#{path}#{s}")) if File.file?(full_path) @@ -159,7 +167,7 @@ module Kernel raise load_error ensure if RUBYGEMS_ACTIVATION_MONITOR.mon_owned? - STDERR.puts [$!, $!.backtrace].inspect + STDERR.puts [$$, Thread.current, $!, $!.backtrace].inspect if $! raise "CRITICAL: RUBYGEMS_ACTIVATION_MONITOR is holding." end end |