From daaffd09aff3343840ca74d1b7ccef40c2f41f4b Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Wed, 2 Nov 2022 18:30:04 +0100 Subject: [PATCH] Bypass git submodule test failure on Git >= 2.38.1. This commit was cherry-picked from Fedora rawhide . This fixes the following test failure. ``` 1) Failure: TestGemSourceGit#test_checkout_submodules [/builddir/build/BUILD/ruby-3.0.4/test/rubygems/test_gem_source_git.rb:72]: fatal: transport 'file' not allowed fatal: clone of '/builddir/build/BUILD/ruby-3.0.4/tmp/test_rubygems_20230627-4031323-yppcjj/git/b' into submodule path '/builddir/build/BUILD/ruby-3.0.4/tmp/test_rubygems_20230627-4031323-yppcjj/git/a/b' failed ``` Resolves: rhbz#2173531 --- ruby-3.2.0-git-2.38.1-fix-rubygems-test.patch | 27 +++++++++++++++++++ ruby.spec | 7 +++++ 2 files changed, 34 insertions(+) create mode 100644 ruby-3.2.0-git-2.38.1-fix-rubygems-test.patch diff --git a/ruby-3.2.0-git-2.38.1-fix-rubygems-test.patch b/ruby-3.2.0-git-2.38.1-fix-rubygems-test.patch new file mode 100644 index 0000000..73f9a02 --- /dev/null +++ b/ruby-3.2.0-git-2.38.1-fix-rubygems-test.patch @@ -0,0 +1,27 @@ +From dae843f6b7502f921a7e66f39e3714a39d860181 Mon Sep 17 00:00:00 2001 +From: Hiroshi SHIBATA +Date: Wed, 19 Oct 2022 19:40:00 +0900 +Subject: [PATCH] Bypass git submodule add/update with git config + protocol.file.allow=always option. + +Co-authored-by: Nobuyoshi Nakada +--- + test/rubygems/test_gem_source_git.rb | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/test/rubygems/test_gem_source_git.rb b/test/rubygems/test_gem_source_git.rb +index 5702da05974b6..c3b324771fa4d 100644 +--- a/test/rubygems/test_gem_source_git.rb ++++ b/test/rubygems/test_gem_source_git.rb +@@ -63,6 +63,11 @@ def test_checkout_local_cached + end + + def test_checkout_submodules ++ # We need to allow to checkout submodules with file:// protocol ++ # CVE-2022-39253 ++ # https://lore.kernel.org/lkml/xmqq4jw1uku5.fsf@gitster.g/ ++ system(@git, *%W"config --global protocol.file.allow always") ++ + source = Gem::Source::Git.new @name, @repository, 'master', true + + git_gem 'b' diff --git a/ruby.spec b/ruby.spec index 22c7594..97b3a62 100644 --- a/ruby.spec +++ b/ruby.spec @@ -261,6 +261,9 @@ Patch59: ruby-3.1.1-ossl_ocsp-use-null.patch # Replace SHA1 usage in tests. # https://github.com/ruby/openssl/pull/511 Patch60: ruby-3.1.2-ossl-tests-replace-sha1.patch +# Bypass git submodule test failure on Git >= 2.38.1. +# https://github.com/ruby/ruby/pull/6587 +Patch61: ruby-3.2.0-git-2.38.1-fix-rubygems-test.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Suggests: rubypick @@ -726,6 +729,7 @@ rm -rf ext/fiddle/libffi* %patch58 -p1 %patch59 %patch60 -p1 +%patch61 -p1 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -1489,6 +1493,9 @@ OPENSSL_ENABLE_SHA1_SIGNATURES=1 \ %changelog +* Wed Jun 28 2023 Jun Aruga - 3.0.4-160 +- Bypass git submodule test failure on Git >= 2.38.1. + * Fri Jul 08 2022 Jarek Prokop - 3.0.4-160 - Upgrade to Ruby 3.0.4. Resolves: rhbz#2096347