From 8ff1912a6642e88f417a7fe92c458b6813868193 Mon Sep 17 00:00:00 2001 From: shixuantong Date: Thu, 29 Dec 2022 10:11:01 +0800 Subject: [PATCH] upgrade version to 3.1.3 --- ...ests-for-template-stylesheets-option.patch | 113 -- backport-CVE-2022-28738.patch | 64 - backport-CVE-2022-28739.patch | 62 - ...kie_new_with_domain-to-pass-on-older.patch | 39 + ...osen-the-domain-regex-to-accept-.-29.patch | 44 + ruby-1.9.3-mkmf-verbose.patch | 25 - ruby-2.3.0-ruby_version.patch | 75 +- ruby-2.3.1-Rely-on-ldd-to-detect-glibc.patch | 30 - ruby-2.7.0-Initialize-ABRT-hook.patch | 6 +- ...-more-support-for-generic-pkey-types.patch | 1004 ------------ ...-specific-options-in-sign-and-verify.patch | 358 ---- ...et-rid-of-type-punning-pointer-casts.patch | 186 --- ruby-3.1.0-Ignore-DW_FORM_ref_addr.patch | 58 - ...gn_raw-verify_raw-and-verify_recover.patch | 1319 --------------- ...eous-changes-for-OpenSSL-3.0-support.patch | 142 -- ruby-3.1.0-Properly-exclude-test-cases.patch | 93 -- ...-Refactor-PEM-DER-serialization-code.patch | 1450 ----------------- ruby-3.1.0-SSL_read-EOF-handling.patch | 16 - ruby-3.1.0-Support-GCCs-DWARF-5.patch | 229 --- ruby-3.1.0-Support-OpenSSL-3.0.patch | 1101 ------------- ruby-3.1.0-Use-EVP-API-in-more-places.patch | 831 ---------- ...face-to-generate-parameters-and-keys.patch | 1113 ------------- ruby-3.1.0-addr2line-DW_FORM_ref_addr.patch | 29 - ruby-3.1.0-autoconf-2.70-add-ac-prog-cc.patch | 27 - ...t_digest-do-not-test-constants-for-l.patch | 29 - ...t_pkcs12-fix-test-failures-with-Open.patch | 439 ----- ...t_pkey-use-EC-keys-for-PKey.generate.patch | 67 - ...t_ssl-relax-regex-to-match-OpenSSL-s.patch | 31 - ...tils-remove-dup_public-helper-method.patch | 265 --- ruby-3.0.3.tar.xz => ruby-3.1.3.tar.xz | Bin 14991880 -> 15300224 bytes ruby.spec | 291 ++-- ...ished-name-which-will-be-correctly-p.patch | 44 - ...ng_system-rb-customizations-too-late.patch | 262 --- 33 files changed, 283 insertions(+), 9559 deletions(-) delete mode 100644 backport-Add-tests-for-template-stylesheets-option.patch delete mode 100644 backport-CVE-2022-28738.patch delete mode 100644 backport-CVE-2022-28739.patch create mode 100644 backport-Fix-test_cgi_cookie_new_with_domain-to-pass-on-older.patch create mode 100644 backport-Loosen-the-domain-regex-to-accept-.-29.patch delete mode 100644 ruby-1.9.3-mkmf-verbose.patch delete mode 100644 ruby-2.3.1-Rely-on-ldd-to-detect-glibc.patch delete mode 100644 ruby-3.1.0-Add-more-support-for-generic-pkey-types.patch delete mode 100644 ruby-3.1.0-Allow-setting-algorithm-specific-options-in-sign-and-verify.patch delete mode 100644 ruby-3.1.0-Get-rid-of-type-punning-pointer-casts.patch delete mode 100644 ruby-3.1.0-Ignore-DW_FORM_ref_addr.patch delete mode 100644 ruby-3.1.0-Implement-PKey-encrypt-decrypt-sign_raw-verify_raw-and-verify_recover.patch delete mode 100644 ruby-3.1.0-Miscellaneous-changes-for-OpenSSL-3.0-support.patch delete mode 100644 ruby-3.1.0-Properly-exclude-test-cases.patch delete mode 100644 ruby-3.1.0-Refactor-PEM-DER-serialization-code.patch delete mode 100644 ruby-3.1.0-SSL_read-EOF-handling.patch delete mode 100644 ruby-3.1.0-Support-GCCs-DWARF-5.patch delete mode 100644 ruby-3.1.0-Support-OpenSSL-3.0.patch delete mode 100644 ruby-3.1.0-Use-EVP-API-in-more-places.patch delete mode 100644 ruby-3.1.0-Use-high-level-EVP-interface-to-generate-parameters-and-keys.patch delete mode 100644 ruby-3.1.0-addr2line-DW_FORM_ref_addr.patch delete mode 100644 ruby-3.1.0-autoconf-2.70-add-ac-prog-cc.patch delete mode 100644 ruby-3.1.0-test-openssl-test_digest-do-not-test-constants-for-l.patch delete mode 100644 ruby-3.1.0-test-openssl-test_pkcs12-fix-test-failures-with-Open.patch delete mode 100644 ruby-3.1.0-test-openssl-test_pkey-use-EC-keys-for-PKey.generate.patch delete mode 100644 ruby-3.1.0-test-openssl-test_ssl-relax-regex-to-match-OpenSSL-s.patch delete mode 100644 ruby-3.1.0-test-openssl-utils-remove-dup_public-helper-method.patch rename ruby-3.0.3.tar.xz => ruby-3.1.3.tar.xz (62%) delete mode 100644 rubygems-3.2.30-Provide-distinguished-name-which-will-be-correctly-p.patch delete mode 100644 rubygems-3.2.33-Fix-loading-operating_system-rb-customizations-too-late.patch diff --git a/backport-Add-tests-for-template-stylesheets-option.patch b/backport-Add-tests-for-template-stylesheets-option.patch deleted file mode 100644 index 66414b1..0000000 --- a/backport-Add-tests-for-template-stylesheets-option.patch +++ /dev/null @@ -1,113 +0,0 @@ -From 76c7388c1f41fb0ae3dacda0d9c02e7562a6655d Mon Sep 17 00:00:00 2001 -From: Nobuyoshi Nakada -Date: Wed, 18 Aug 2021 13:48:12 +0900 -Subject: [PATCH] [ruby/rdoc] Add tests for `--template-stylesheets` option - -Also flattens `@options.template_stylesheets` when parsing the -command lines. - -Fixes #205 -Fixes #828 too - -https://github.com/ruby/rdoc/commit/857002a763 ---- - lib/rdoc/generator/darkfish.rb | 4 ++-- - lib/rdoc/generator/template/darkfish/_head.rhtml | 4 +--- - lib/rdoc/options.rb | 2 +- - test/rdoc/test_rdoc_generator_darkfish.rb | 14 ++++++++++++++ - test/rdoc/test_rdoc_options.rb | 15 +++++++++++++++ - 5 files changed, 33 insertions(+), 6 deletions(-) - -diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb -index b46861d009b2..60e0265e8c7c 100644 ---- a/lib/rdoc/generator/darkfish.rb -+++ b/lib/rdoc/generator/darkfish.rb -@@ -220,8 +220,8 @@ def write_style_sheet - install_rdoc_static_file @template_dir + item, "./#{item}", options - end - -- @options.template_stylesheets.each do |stylesheet| -- FileUtils.cp stylesheet, '.', options -+ unless @options.template_stylesheets.empty? -+ FileUtils.cp @options.template_stylesheets, '.', **options - end - - Dir[(@template_dir + "{js,images}/**/*").to_s].each do |path| -diff --git a/lib/rdoc/generator/template/darkfish/_head.rhtml b/lib/rdoc/generator/template/darkfish/_head.rhtml -index e61fce1b9ae1..4f331245c3a8 100644 ---- a/lib/rdoc/generator/template/darkfish/_head.rhtml -+++ b/lib/rdoc/generator/template/darkfish/_head.rhtml -@@ -15,8 +15,6 @@ - - - --<%- if @options.template_stylesheets.flatten.any? then -%> --<%- @options.template_stylesheets.flatten.each do |stylesheet| -%> -+<%- @options.template_stylesheets.each do |stylesheet| -%> - --<%- end -%> - <%- end -%> -diff --git a/lib/rdoc/options.rb b/lib/rdoc/options.rb -index 7a45a9c61098..792b473b7939 100644 ---- a/lib/rdoc/options.rb -+++ b/lib/rdoc/options.rb -@@ -971,7 +971,7 @@ def parse argv - opt.on("--template-stylesheets=FILES", PathArray, - "Set (or add to) the list of files to", - "include with the html template.") do |value| -- @template_stylesheets << value -+ @template_stylesheets.concat value - end - - opt.separator nil -diff --git a/test/rdoc/test_rdoc_generator_darkfish.rb b/test/rdoc/test_rdoc_generator_darkfish.rb -index f5858bce6e6d..3de4f8b6d678 100644 ---- a/test/rdoc/test_rdoc_generator_darkfish.rb -+++ b/test/rdoc/test_rdoc_generator_darkfish.rb -@@ -220,6 +220,20 @@ def test_generated_method_with_html_tag_yield - assert_includes method_name, '{ |%<<script>alert("atui")</script>>, yield_arg| ... }' - end - -+ def test_template_stylesheets -+ css = Tempfile.create(%W'hoge .css', Dir.mktmpdir('tmp', '.')) -+ File.write(css, '') -+ base = File.basename(css) -+ refute_file(base) -+ -+ @options.template_stylesheets << css -+ -+ @g.generate -+ -+ assert_file base -+ assert_include File.read('index.html'), %Q[href="./#{base}"] -+ end -+ - ## - # Asserts that +filename+ has a link count greater than 1 if hard links to - # @tmpdir are supported. -diff --git a/test/rdoc/test_rdoc_options.rb b/test/rdoc/test_rdoc_options.rb -index 206ddeeb2c17..7c264c5e86b6 100644 ---- a/test/rdoc/test_rdoc_options.rb -+++ b/test/rdoc/test_rdoc_options.rb -@@ -632,6 +632,21 @@ def test_parse_template_load_path - $LOAD_PATH.replace orig_LOAD_PATH - end - -+ def test_parse_template_stylesheets -+ css = nil -+ Dir.mktmpdir do |dir| -+ css = File.join(dir, "hoge.css") -+ File.write(css, "") -+ out, err = capture_output do -+ @options.parse %W[--template-stylesheets #{css}] -+ end -+ -+ assert_empty out -+ assert_empty err -+ end -+ assert_include @options.template_stylesheets, css -+ end -+ - def test_parse_visibility - @options.parse %w[--visibility=public] - assert_equal :public, @options.visibility diff --git a/backport-CVE-2022-28738.patch b/backport-CVE-2022-28738.patch deleted file mode 100644 index 8d72114..0000000 --- a/backport-CVE-2022-28738.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 052ec6d2585c3ace95671013d336f5543624ef3d Mon Sep 17 00:00:00 2001 -From: nagachika -Date: Tue, 12 Apr 2022 20:07:08 +0900 -Subject: [PATCH] Just free compiled pattern if no space is used - ---- - regcomp.c | 14 ++++++++------ - test/ruby/test_regexp.rb | 9 +++++++++ - 2 files changed, 17 insertions(+), 6 deletions(-) - -diff --git a/regcomp.c b/regcomp.c -index 3a438b94c4a5..bd383138753d 100644 ---- a/regcomp.c -+++ b/regcomp.c -@@ -142,8 +142,13 @@ bitset_on_num(BitSetRef bs) - static void - onig_reg_resize(regex_t *reg) - { -- resize: -- if (reg->alloc > reg->used) { -+ do { -+ if (!reg->used) { -+ xfree(reg->p); -+ reg->alloc = 0; -+ reg->p = 0; -+ } -+ else if (reg->alloc > reg->used) { - unsigned char *new_ptr = xrealloc(reg->p, reg->used); - // Skip the right size optimization if memory allocation fails - if (new_ptr) { -@@ -151,10 +156,7 @@ onig_reg_resize(regex_t *reg) - reg->p = new_ptr; - } - } -- if (reg->chain) { -- reg = reg->chain; -- goto resize; -- } -+ } while ((reg = reg->chain) != 0); - } - - extern int -diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb -index 35d20eeda656..679a013cf041 100644 ---- a/test/ruby/test_regexp.rb -+++ b/test/ruby/test_regexp.rb -@@ -1344,6 +1344,15 @@ def test_backref_overrun - end - end - -+ def test_invalid_group -+ assert_separately([], "#{<<-"begin;"}\n#{<<-'end;'}") -+ begin; -+ assert_raise_with_message(RegexpError, /invalid conditional pattern/) do -+ Regexp.new("((?(1)x|x|)x)+") -+ end -+ end; -+ end -+ - # This assertion is for porting x2() tests in testpy.py of Onigmo. - def assert_match_at(re, str, positions, msg = nil) - re = Regexp.new(re) unless re.is_a?(Regexp) --- -1.8.3.1 diff --git a/backport-CVE-2022-28739.patch b/backport-CVE-2022-28739.patch deleted file mode 100644 index 69bf06e..0000000 --- a/backport-CVE-2022-28739.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 3fa771ddedac25560be57f4055f1767e6c810f58 Mon Sep 17 00:00:00 2001 -From: nagachika -Date: Tue, 12 Apr 2022 20:08:08 +0900 -Subject: [PATCH] Fix dtoa buffer overrun - ---- - missing/dtoa.c | 3 ++- - test/ruby/test_float.rb | 18 ++++++++++++++++++ - 2 files changed, 20 insertions(+), 1 deletions(-) - -diff --git a/missing/dtoa.c b/missing/dtoa.c -index a940eabd9141..b7a83028758b 100644 ---- a/missing/dtoa.c -+++ b/missing/dtoa.c -@@ -1552,6 +1552,7 @@ strtod(const char *s00, char **se) - if (!*++s || !(s1 = strchr(hexdigit, *s))) goto ret0; - if (*s == '0') { - while (*++s == '0'); -+ if (!*s) goto ret; - s1 = strchr(hexdigit, *s); - } - if (s1 != NULL) { -@@ -1574,7 +1575,7 @@ strtod(const char *s00, char **se) - for (; *s && (s1 = strchr(hexdigit, *s)); ++s) { - adj += aadj * ((s1 - hexdigit) & 15); - if ((aadj /= 16) == 0.0) { -- while (strchr(hexdigit, *++s)); -+ while (*++s && strchr(hexdigit, *s)); - break; - } - } -diff --git a/test/ruby/test_float.rb b/test/ruby/test_float.rb -index fbf0d87f8efd..b218b72db52c 100644 ---- a/test/ruby/test_float.rb -+++ b/test/ruby/test_float.rb -@@ -171,6 +171,24 @@ def test_strtod - assert_raise(ArgumentError, n += z + "A") {Float(n)} - assert_raise(ArgumentError, n += z + ".0") {Float(n)} - end -+ -+ x = nil -+ 2000.times do -+ x = Float("0x"+"0"*30) -+ break unless x == 0.0 -+ end -+ assert_equal(0.0, x, ->{"%a" % x}) -+ x = nil -+ 2000.times do -+ begin -+ x = Float("0x1."+"0"*270) -+ rescue ArgumentError => e -+ raise unless /"0x1\.0{270}"/ =~ e.message -+ else -+ break -+ end -+ end -+ assert_nil(x, ->{"%a" % x}) - end - - def test_divmod --- -1.8.3.1 diff --git a/backport-Fix-test_cgi_cookie_new_with_domain-to-pass-on-older.patch b/backport-Fix-test_cgi_cookie_new_with_domain-to-pass-on-older.patch new file mode 100644 index 0000000..d0aaa2b --- /dev/null +++ b/backport-Fix-test_cgi_cookie_new_with_domain-to-pass-on-older.patch @@ -0,0 +1,39 @@ +From 05f0c58048540e868d9bbc6e49151b27e1bc89e9 Mon Sep 17 00:00:00 2001 +From: Jean Boussier +Date: Wed, 23 Nov 2022 12:10:36 +0100 +Subject: [PATCH] Fix test_cgi_cookie_new_with_domain to pass on older rubies + +--- + test/cgi/test_cgi_cookie.rb | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/test/cgi/test_cgi_cookie.rb b/test/cgi/test_cgi_cookie.rb +index e3ec4be..6d31932 100644 +--- a/test/cgi/test_cgi_cookie.rb ++++ b/test/cgi/test_cgi_cookie.rb +@@ -62,18 +62,18 @@ class CGICookieTest < Test::Unit::TestCase + + def test_cgi_cookie_new_with_domain + h = {'name'=>'name1', 'value'=>'value1'} +- cookie = CGI::Cookie.new('domain'=>'a.example.com', **h) ++ cookie = CGI::Cookie.new(h.merge('domain'=>'a.example.com')) + assert_equal('a.example.com', cookie.domain) + +- cookie = CGI::Cookie.new('domain'=>'1.example.com', **h) ++ cookie = CGI::Cookie.new(h.merge('domain'=>'1.example.com')) + assert_equal('1.example.com', cookie.domain, 'enhanced by RFC 1123') + + assert_raise(ArgumentError) { +- CGI::Cookie.new('domain'=>'-a.example.com', **h) ++ CGI::Cookie.new(h.merge('domain'=>'-a.example.com')) + } + + assert_raise(ArgumentError) { +- CGI::Cookie.new('domain'=>'a-.example.com', **h) ++ CGI::Cookie.new(h.merge('domain'=>'a-.example.com')) + } + end + +-- +2.33.0 + diff --git a/backport-Loosen-the-domain-regex-to-accept-.-29.patch b/backport-Loosen-the-domain-regex-to-accept-.-29.patch new file mode 100644 index 0000000..a5c9c2b --- /dev/null +++ b/backport-Loosen-the-domain-regex-to-accept-.-29.patch @@ -0,0 +1,44 @@ +From 5e09d632f3b56d85b2659ab47d5571ae9e270e10 Mon Sep 17 00:00:00 2001 +From: Xenor Chang +Date: Mon, 28 Nov 2022 12:34:06 +0800 +Subject: [PATCH] Loosen the domain regex to accept '.' (#29) + +* Loosen the domain regex to accept '.' + +Co-authored-by: Nobuyoshi Nakada +Co-authored-by: Hiroshi SHIBATA +--- + lib/cgi/cookie.rb | 2 +- + test/cgi/test_cgi_cookie.rb | 3 +++ + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lib/cgi/cookie.rb b/lib/cgi/cookie.rb +index 1a9c1a8..9498e2f 100644 +--- a/lib/cgi/cookie.rb ++++ b/lib/cgi/cookie.rb +@@ -42,7 +42,7 @@ class CGI + + TOKEN_RE = %r"\A[[!-~]&&[^()<>@,;:\\\"/?=\[\]{}]]+\z" + PATH_VALUE_RE = %r"\A[[ -~]&&[^;]]*\z" +- DOMAIN_VALUE_RE = %r"\A(?