Fix test suite issue caused by change fix of CVE-2018-6914 in Ruby.

f38
Vít Ondruch 7 years ago
parent f360bcace6
commit 3977e11555

@ -0,0 +1,26 @@
From ca4be4b7788c90d94beb1e835b7019f809148d08 Mon Sep 17 00:00:00 2001
From: Andrew White <andrew.white@unboxed.co>
Date: Mon, 2 Apr 2018 09:34:53 +0100
Subject: [PATCH] Backport fix for Dir::Tmpname.create from #32386
The removal of path separators from the tmpname value affects all four
supported versions of Ruby - 2.2.10, 2.3.7, 2.4.4, and 2.5.1.
---
activesupport/test/caching_test.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb
index c67ffe69b80a..c138f10c13a5 100644
--- a/activesupport/test/caching_test.rb
+++ b/activesupport/test/caching_test.rb
@@ -854,7 +854,9 @@ def test_key_transformation_with_pathname
def test_filename_max_size
key = "#{'A' * ActiveSupport::Cache::FileStore::FILENAME_MAX_SIZE}"
path = @cache.send(:normalize_key, key, {})
- Dir::Tmpname.create(path) do |tmpname, n, opts|
+ basename = File.basename(path)
+ dirname = File.dirname(path)
+ Dir::Tmpname.create(basename, Dir.tmpdir + dirname) do |tmpname, n, opts|
assert File.basename(tmpname + ".lock").length <= 255, "Temp filename too long: #{File.basename(tmpname + '.lock').length}"
end
end

@ -3,7 +3,7 @@
Name: rubygem-%{gem_name}
Epoch: 1
Version: 5.1.5
Release: 2%{?dist}
Release: 3%{?dist}
Summary: A support libraries and Ruby core extensions extracted from the Rails framework
Group: Development/Languages
License: MIT
@ -17,6 +17,10 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# git checkout v5.1.5 && tar czvf activesupport-5.1.5-tests.tgz test/
Source1: %{gem_name}-%{version}-tests.tgz
# Fix test suite issue caused by change fix of CVE-2018-6914 in Ruby.
# https://github.com/rails/rails/commit/ca4be4b7788c90d94beb1e835b7019f809148d08
Patch1: rubygem-activesupport-5.1.7-Fix-FileStoreTest-test_filename_max_size-fails.patch
# ruby package has just soft dependency on rubygem({bigdecimal,json}), while
# ActiveSupport always requires them.
Requires: rubygem(bigdecimal)
@ -75,6 +79,8 @@ pushd .%{gem_instdir}
# Move the tests into place
tar xzvf %{SOURCE1}
cat %{PATCH1} | patch -p2
# These tests are really unstable, but they seems to be passing upstream :/
for f in test/evented_file_update_checker_test.rb; do
mv $f{,.disable}
@ -103,6 +109,9 @@ popd
%doc %{gem_instdir}/README.rdoc
%changelog
* Mon Apr 16 2018 Vít Ondruch <vondruch@redhat.com> - 1:5.1.5-3
- Fix test suite issue caused by change fix of CVE-2018-6914 in Ruby.
* Wed Feb 21 2018 Pavel Valena <pvalena@redhat.com> - 1:5.1.5-2
- Allow rubygem-i18n ~> 1.0
https://github.com/rails/rails/pull/31991

Loading…
Cancel
Save