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

ruby-changes:58658

From: Yusuke <ko1@a...>
Date: Sat, 9 Nov 2019 00:25:42 +0900 (JST)
Subject: [ruby-changes:58658] 9deca1a3b9 (master): Try to fix test-spec failure on macOS

https://git.ruby-lang.org/ruby.git/commit/?id=9deca1a3b9

From 9deca1a3b91271159e164188367f003978737f42 Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Sat, 9 Nov 2019 00:22:25 +0900
Subject: Try to fix test-spec failure on macOS

Not sure what is happening, but spec/ruby/security/cve_2018_6914_spec.rb
fails on macOS.
https://github.com/ruby/ruby/runs/294462511#step:10:134

I suspect that the state of a directory is weird immediately after it is
created (not writable or even world writable?).  This change tries to
make sure that ENV["TMPDIR"] is actually used by Dir.tmpdir.

diff --git a/spec/ruby/security/cve_2018_6914_spec.rb b/spec/ruby/security/cve_2018_6914_spec.rb
index dc2f2cd..3cebff2 100644
--- a/spec/ruby/security/cve_2018_6914_spec.rb
+++ b/spec/ruby/security/cve_2018_6914_spec.rb
@@ -9,6 +9,14 @@ 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)
     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
+
     @dir << '/'
 
     @tempfile = nil
-- 
cgit v0.10.2


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

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