[前][次][番号順一覧][スレッド一覧]

ruby-changes:37390

From: nagachika <ko1@a...>
Date: Mon, 2 Feb 2015 22:45:41 +0900 (JST)
Subject: [ruby-changes:37390] nagachika:r49471 (ruby_2_1): merge revision(s) r48534: [Backport #10412]

nagachika	2015-02-02 22:45:35 +0900 (Mon, 02 Feb 2015)

  New Revision: 49471

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49471

  Log:
    merge revision(s) r48534: [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

  Modified directories:
    branches/ruby_2_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/lib/resolv.rb
    branches/ruby_2_1/test/resolv/test_dns.rb
    branches/ruby_2_1/version.h
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 49470)
+++ ruby_2_1/ChangeLog	(revision 49471)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Mon Feb  2 22:43:42 2015  Aaron Patterson <aaron@t...>
+
+	* 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@r...>
 
 	* configure.in (rb_cv_binary_elf): get rid of -e option of cat
Index: ruby_2_1/lib/resolv.rb
===================================================================
--- ruby_2_1/lib/resolv.rb	(revision 49470)
+++ ruby_2_1/lib/resolv.rb	(revision 49471)
@@ -1070,6 +1070,10 @@ class Resolv https://github.com/ruby/ruby/blob/trunk/ruby_2_1/lib/resolv.rb#L1070
             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
Index: ruby_2_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 49470)
+++ ruby_2_1/version.h	(revision 49471)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #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
Index: ruby_2_1/test/resolv/test_dns.rb
===================================================================
--- ruby_2_1/test/resolv/test_dns.rb	(revision 49470)
+++ ruby_2_1/test/resolv/test_dns.rb	(revision 49471)
@@ -23,6 +23,20 @@ class TestResolvDNS < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/resolv/test_dns.rb#L23
     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

Property changes on: ruby_2_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r48534


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]