ruby-changes:58685
From: Nobuyoshi <ko1@a...>
Date: Sat, 9 Nov 2019 23:04:45 +0900 (JST)
Subject: [ruby-changes:58685] 03fdf02321 (master): Removed trial and errors
https://git.ruby-lang.org/ruby.git/commit/?id=03fdf02321 From 03fdf02321d4ac3123fb6908e7be53e232a92b67 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sat, 9 Nov 2019 23:00:32 +0900 Subject: Removed trial and errors diff --git a/spec/ruby/security/cve_2018_6914_spec.rb b/spec/ruby/security/cve_2018_6914_spec.rb index f1bd2c6..f0aedb0 100644 --- a/spec/ruby/security/cve_2018_6914_spec.rb +++ b/spec/ruby/security/cve_2018_6914_spec.rb @@ -9,27 +9,6 @@ describe "CVE-2018-6914 is resisted by" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/security/cve_2018_6914_spec.rb#L9 @dir = tmp("CVE-2018-6914") Dir.mkdir(@dir, 0700) ENV['TMPDIR'] = @dir - - # Make sure that ENV["TMPDIR"] is used by Dir.tmpdir - # https://github.com/ruby/ruby/runs/294462511#step:10:134 - 10.times do - break if Dir.tmpdir == File.expand_path(@dir) - sleep 0.1 - end - - @debug_print = ->(actual) { - PP.pp({ - actual: actual, - absolute: File.absolute_path(actual), - dir: @dir, - pwd: Dir.pwd, - tmpdir: @tmpdir, - Dir_tmpdir: Dir.tmpdir, - TMPDIR: ENV['TMPDIR'], - stat: File.stat(@dir), - }, STDERR) - } - @dir << '/' @tempfile = nil @@ -44,14 +23,12 @@ describe "CVE-2018-6914 is resisted by" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/security/cve_2018_6914_spec.rb#L23 it "Tempfile.open by deleting separators" do @tempfile = Tempfile.open(['../', 'foo']) actual = @tempfile.path - @debug_print.call(actual) File.absolute_path(actual).should.start_with?(@dir) end it "Tempfile.new by deleting separators" do @tempfile = Tempfile.new('../foo') actual = @tempfile.path - @debug_print.call(actual) File.absolute_path(actual).should.start_with?(@dir) end @@ -59,7 +36,6 @@ describe "CVE-2018-6914 is resisted by" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/security/cve_2018_6914_spec.rb#L36 actual = Tempfile.create('../foo') do |t| t.path end - @debug_print.call(actual) File.absolute_path(actual).should.start_with?(@dir) end @@ -67,7 +43,6 @@ describe "CVE-2018-6914 is resisted by" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/security/cve_2018_6914_spec.rb#L43 actual = Dir.mktmpdir('../foo') do |path| path end - @debug_print.call(actual) File.absolute_path(actual).should.start_with?(@dir) end @@ -75,7 +50,6 @@ describe "CVE-2018-6914 is resisted by" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/security/cve_2018_6914_spec.rb#L50 actual = Dir.mktmpdir(['../', 'foo']) do |path| path end - @debug_print.call(actual) File.absolute_path(actual).should.start_with?(@dir) end end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/