diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/resolv.rb | 4 | ||||
-rw-r--r-- | test/resolv/test_dns.rb | 14 | ||||
-rw-r--r-- | version.h | 2 |
4 files changed, 26 insertions, 1 deletions
@@ -1,3 +1,10 @@ +Mon Feb 2 22:43:42 2015 Aaron Patterson <aaron@tenderlovemaking.com> + + * 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 + Mon Feb 2 22:38:53 2015 Nobuyoshi Nakada <nobu@ruby-lang.org> * configure.in (rb_cv_binary_elf): get rid of -e option of cat diff --git a/lib/resolv.rb b/lib/resolv.rb index 60b2d9091c..47457027b1 100644 --- a/lib/resolv.rb +++ b/lib/resolv.rb @@ -1070,6 +1070,10 @@ class Resolv 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 07396fb177..4d83d88a17 100644 --- a/test/resolv/test_dns.rb +++ b/test/resolv/test_dns.rb @@ -23,6 +23,20 @@ class TestResolvDNS < Test::Unit::TestCase 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 @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.1.5" #define RUBY_RELEASE_DATE "2015-02-02" -#define RUBY_PATCHLEVEL 287 +#define RUBY_PATCHLEVEL 288 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 2 |