BIND 10 trac1288, updated. 36a5cd751a12ccbd31284ea19d0b10e8a5836b70 [1288] another LIBRARY_PATH_PLACEHOLDER hack: xfrout test will also need it.

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Nov 15 17:44:14 UTC 2011


The branch, trac1288 has been updated
       via  36a5cd751a12ccbd31284ea19d0b10e8a5836b70 (commit)
       via  f1cb067ea86ab38810007ec6743e7c1f91042e99 (commit)
       via  6ddab5f4ea56162d0834e22a68605a1a427cc8c2 (commit)
      from  8a5b3e3b460e7f741b1560f73423c8d688db9d85 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 36a5cd751a12ccbd31284ea19d0b10e8a5836b70
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Tue Nov 15 09:43:47 2011 -0800

    [1288] another LIBRARY_PATH_PLACEHOLDER hack: xfrout test will also need it.

commit f1cb067ea86ab38810007ec6743e7c1f91042e99
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Tue Nov 15 09:42:27 2011 -0800

    [1288] (unrelated cleanup) removed now-unnecessary setting

commit 6ddab5f4ea56162d0834e22a68605a1a427cc8c2
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Tue Nov 15 09:40:24 2011 -0800

    [1288] catch exception from _check_xfrout_available and return SERVFAIL
    in that case.  also log that event.  added a test case for it.

-----------------------------------------------------------------------

Summary of changes:
 src/bin/xfrout/tests/Makefile.am       |    3 +++
 src/bin/xfrout/tests/xfrout_test.py.in |    9 +++++++--
 src/bin/xfrout/xfrout.py.in            |    7 ++++++-
 src/bin/xfrout/xfrout_messages.mes     |    7 +++++++
 4 files changed, 23 insertions(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/bin/xfrout/tests/Makefile.am b/src/bin/xfrout/tests/Makefile.am
index b06921b..509df79 100644
--- a/src/bin/xfrout/tests/Makefile.am
+++ b/src/bin/xfrout/tests/Makefile.am
@@ -11,6 +11,9 @@ EXTRA_DIST += testdata/example.com
 LIBRARY_PATH_PLACEHOLDER =
 if SET_ENV_LIBRARY_PATH
 LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/cryptolink/.libs:$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/lib/cc/.libs:$(abs_top_builddir)/src/lib/config/.libs:$(abs_top_builddir)/src/lib/log/.libs:$(abs_top_builddir)/src/lib/util/.libs:$(abs_top_builddir)/src/lib/exceptions/.libs:$(abs_top_builddir)/src/lib/util/io/.libs:$(abs_top_builddir)/src/lib/datasrc/.libs:$(abs_top_builddir)/src/lib/acl/.libs:$$$(ENV_LIBRARY_PATH)
+else
+# Some systems need the ds path even if not all paths are necessary
+LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/datasrc/.libs
 endif
 
 # test using command-line arguments, so use check-local target instead of TESTS
diff --git a/src/bin/xfrout/tests/xfrout_test.py.in b/src/bin/xfrout/tests/xfrout_test.py.in
index 6d64c91..8394b0a 100644
--- a/src/bin/xfrout/tests/xfrout_test.py.in
+++ b/src/bin/xfrout/tests/xfrout_test.py.in
@@ -648,7 +648,6 @@ class TestXfroutSession(TestXfroutSessionBase):
         return "example.com"
 
     def test_dns_xfrout_start_notauth(self):
-        self.xfrsess._get_query_zone_name = self.default
         def notauth(formpara):
             return Rcode.NOTAUTH()
         self.xfrsess._check_xfrout_available = notauth
@@ -656,8 +655,14 @@ class TestXfroutSession(TestXfroutSessionBase):
         get_msg = self.sock.read_msg()
         self.assertEqual(get_msg.get_rcode().to_text(), "NOTAUTH")
 
+    def test_dns_xfrout_start_datasrc_servfail(self):
+        def internal_raise(x, y):
+            raise isc.datasrc.Error('exception for the sake of test')
+        self.xfrsess.ClientClass = internal_raise
+        self.xfrsess.dns_xfrout_start(self.sock, self.mdata)
+        self.assertEqual(self.sock.read_msg().get_rcode(), Rcode.SERVFAIL())
+
     def test_dns_xfrout_start_noerror(self):
-        self.xfrsess._get_query_zone_name = self.default
         def noerror(form):
             return Rcode.NOERROR()
         self.xfrsess._check_xfrout_available = noerror
diff --git a/src/bin/xfrout/xfrout.py.in b/src/bin/xfrout/xfrout.py.in
index f918cca..a473322 100755
--- a/src/bin/xfrout/xfrout.py.in
+++ b/src/bin/xfrout/xfrout.py.in
@@ -363,7 +363,12 @@ class XfroutSession():
         zone_str = format_zone_str(zone_name, zone_class) # for logging
 
         # TODO: we should also include class in the check
-        rcode_ = self._check_xfrout_available(zone_name)
+        try:
+            rcode_ = self._check_xfrout_available(zone_name)
+        except Exception as ex:
+            logger.error(XFROUT_XFR_TRANSFER_CHECK_ERROR, self._request_type,
+                         format_addrinfo(self._remote), zone_str, ex)
+            rcode_ = Rcode.SERVFAIL()
         if rcode_ != Rcode.NOERROR():
             logger.info(XFROUT_AXFR_TRANSFER_FAILED, self._request_type,
                         format_addrinfo(self._remote), zone_str, rcode_)
diff --git a/src/bin/xfrout/xfrout_messages.mes b/src/bin/xfrout/xfrout_messages.mes
index ed40d5c..894ade5 100644
--- a/src/bin/xfrout/xfrout_messages.mes
+++ b/src/bin/xfrout/xfrout_messages.mes
@@ -25,6 +25,13 @@ an AXFR query. The error message of the exception is included in the
 log message, but this error most likely points to incomplete exception
 handling in the code.
 
+% XFROUT_XFR_TRANSFER_CHECK_ERROR %1 client %2: check for transfer of %3 failed: %4
+Pre-response check for an incomding XFR request failed unexpectedly.
+The most likely cause of this is that some low level error in the data
+source, but it may also be other general (more unlikely) errors such
+as memory shortage.  Some detail of the error is also included in the
+message.  The xfrout server tries to return a SERVFAIL response in this case.
+
 % XFROUT_AXFR_TRANSFER_FAILED %1 client %2: transfer of %3 failed, rcode: %4
 A transfer out for the given zone failed. An error response is sent
 to the client. The given rcode is the rcode that is set in the error




More information about the bind10-changes mailing list