From ca6c97f7194f3d9241b47229b6a6974ccde03540 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 23 2015 08:59:27 +0000 Subject: import ruby-2.0.0.598-25.el7_1 --- diff --git a/SOURCES/ruby-2.0.0-p607-DNS-Resolv-fall-back-if-canonicalization-fails.patch b/SOURCES/ruby-2.0.0-p607-DNS-Resolv-fall-back-if-canonicalization-fails.patch new file mode 100644 index 0000000..539fc7e --- /dev/null +++ b/SOURCES/ruby-2.0.0-p607-DNS-Resolv-fall-back-if-canonicalization-fails.patch @@ -0,0 +1,73 @@ +From d52aaa5a5ebf281f96eac136ba68e63295c5bb8e Mon Sep 17 00:00:00 2001 +From: usa +Date: Wed, 14 Jan 2015 06:55:00 +0000 +Subject: [PATCH] merge revision(s) 48534: [Backport #10412] + + * lib/resolv.rb: fall back if canonicalization fails. + Thanks Vit Ondruch for the patch! [ruby-core:65836] + + * test/resolv/test_dns.rb: test for patch + + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@49245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + ChangeLog | 7 +++++++ + lib/resolv.rb | 4 ++++ + test/resolv/test_dns.rb | 14 ++++++++++++++ + 3 files changed, 25 insertions(+), 0 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 1aea7c0..8ea4238 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,10 @@ ++Wed Jan 14 15:54:18 2015 Aaron Patterson ++ ++ * lib/resolv.rb: fall back if canonicalization fails. ++ Thanks Vit Ondruch for the patch! [ruby-core:65836] ++ ++ * test/resolv/test_dns.rb: test for patch ++ + Thu Nov 13 22:31:50 2014 CHIKANAGA Tomoyuki + + * lib/rexml/document.rb: add REXML::Document#document. +diff --git a/lib/resolv.rb b/lib/resolv.rb +index 53bfd54..a302d8a 100644 +--- a/lib/resolv.rb ++++ b/lib/resolv.rb +@@ -1039,6 +1039,10 @@ def generate_candidates(name) + candidates = [] + end + candidates.concat(@search.map {|domain| Name.new(name.to_a + domain)}) ++ fname = Name.create("#{name}.") ++ if !candidates.include?(fname) ++ candidates << fname ++ end + end + return candidates + end +diff --git a/test/resolv/test_dns.rb b/test/resolv/test_dns.rb +index 07396fb..4d83d88 100644 +--- a/test/resolv/test_dns.rb ++++ b/test/resolv/test_dns.rb +@@ -23,6 +23,20 @@ def with_udp(host, port) + end + end + ++ # [ruby-core:65836] ++ def test_resolve_with_2_ndots ++ conf = Resolv::DNS::Config.new :nameserver => ['127.0.0.1'], :ndots => 2 ++ assert conf.single? ++ ++ candidates = [] ++ conf.resolv('example.com') { |candidate, *args| ++ candidates << candidate ++ raise Resolv::DNS::Config::NXDomain ++ } ++ n = Resolv::DNS::Name.create 'example.com.' ++ assert_equal n, candidates.last ++ end ++ + def test_query_ipv4_address + begin + OpenSSL diff --git a/SPECS/ruby.spec b/SPECS/ruby.spec index f4fe289..7cda2ca 100644 --- a/SPECS/ruby.spec +++ b/SPECS/ruby.spec @@ -26,7 +26,7 @@ %endif -%global release 24 +%global release 25 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} %global rubygems_version 2.0.14 @@ -158,6 +158,9 @@ Patch23: ruby-openssl-wrap-cipher-fix.patch # CVE-2014-4975: Fix off-by-one stack-based buffer overflow in the encodes() function # https://bugs.ruby-lang.org/issues/10019 Patch24: ruby-2.1.0-CVE-2014-4975-fix-buffer-overru-by-tail_lf.patch +# DNS Resolv broken when resolv.conf has option ndots > 1 +# https://bugzilla.redhat.com/show_bug.cgi?id=1200419 +Patch25: ruby-2.0.0-p607-DNS-Resolv-fall-back-if-canonicalization-fails.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: ruby(rubygems) >= %{rubygems_version} # Make the bigdecimal gem a runtime dependency of Ruby to avoid problems @@ -426,6 +429,7 @@ Tcl/Tk interface for the object-oriented scripting language Ruby. %patch18 -p1 %patch23 -p1 %patch24 +%patch25 -p1 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -889,6 +893,10 @@ OPENSSL_ENABLE_MD5_VERIFY=1 make check TESTS="-v $DISABLE_TESTS" %{ruby_libdir}/tkextlib %changelog +* Mon Apr 27 2015 Vít Ondruch - 2.0.0.598-25 +- Fix broken DNS Resolv when resolv.conf has option ndots > 1. + Resolves: rhbz#1200419 + * Fri Nov 14 2014 Vít Ondruch - 2.0.0.598-24 - Rebased to Ruby 2.0.0-p598. * Remove Patch19: ruby-2.0.0-p247-Make-stable-Gem-Specification.files-in-