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 66414b13d543ceea267cdcdf463a8ea534537042..0000000000000000000000000000000000000000 --- 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 8d7211428e00580adfbe619d25ecace88b9042ca..0000000000000000000000000000000000000000 --- 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 69bf06e475e660c801fbba9e0be5a5a700e0cfa1..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..d0aaa2b40ea61d3164bc0b70db29d688278a2008 --- /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 0000000000000000000000000000000000000000..a5c9c2b407449f7310fcfaf12816d5435422fa52 --- /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(?