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

ruby-changes:72849

From: Nobuyoshi <ko1@a...>
Date: Sun, 7 Aug 2022 17:58:12 +0900 (JST)
Subject: [ruby-changes:72849] 03f86565a6 (master): Silent backtrace from cve_2019_8325_spec.rb

https://git.ruby-lang.org/ruby.git/commit/?id=03f86565a6

From 03f86565a69687b335d16d873e2b1f35cb356bec Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sun, 7 Aug 2022 17:57:52 +0900
Subject: Silent backtrace from cve_2019_8325_spec.rb

Since the change at f310ac1cb2964f635f582862763b2155aacf2c12 to show
the backtraces by default, this test started to show the backtraces.
As the backtraces are not the subject of this test, silence them by
using Gem::SilentUI.
---
 spec/ruby/security/cve_2019_8325_spec.rb | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/spec/ruby/security/cve_2019_8325_spec.rb b/spec/ruby/security/cve_2019_8325_spec.rb
index 04692e01fe..7c5e216568 100644
--- a/spec/ruby/security/cve_2019_8325_spec.rb
+++ b/spec/ruby/security/cve_2019_8325_spec.rb
@@ -5,8 +5,16 @@ require 'rubygems/command_manager' https://github.com/ruby/ruby/blob/trunk/spec/ruby/security/cve_2019_8325_spec.rb#L5
 
 describe "CVE-2019-8325 is resisted by" do
   describe "sanitising error message components" do
+    silent_ui = Module.new do
+      attr_accessor :ui
+      def self.extended(obj)
+        obj.ui = Gem::SilentUI.new
+      end
+    end
+
     it "for the 'while executing' message" do
       manager = Gem::CommandManager.new
+      manager.extend(silent_ui)
       def manager.process_args(args, build_args)
         raise StandardError, "\e]2;nyan\a"
       end
@@ -26,6 +34,7 @@ describe "CVE-2019-8325 is resisted by" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/security/cve_2019_8325_spec.rb#L34
 
     it "for the 'loading command' message" do
       manager = Gem::CommandManager.new
+      manager.extend(silent_ui)
       def manager.require(x)
         raise 'foo'
       end
-- 
cgit v1.2.1


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

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