BIND 10 trac1790, updated. 4e20d036b7ed183e51deb160bb4530e6e7d54eb2 [1790] Address review comments (see full log)
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Apr 20 11:07:37 UTC 2012
The branch, trac1790 has been updated
via 4e20d036b7ed183e51deb160bb4530e6e7d54eb2 (commit)
from 053f67d53fc956ea60065b71ad042654bba17a7c (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 4e20d036b7ed183e51deb160bb4530e6e7d54eb2
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Apr 20 16:35:59 2012 +0530
[1790] Address review comments (see full log)
* The filetype parameter is optional, which means it might be missing
from the dict. Therefore indexing it with zone["filetype"] without
further check is unsafe. We check for this key now.
* The handling of origin and dots is needlessly complicated. We now
create Name objects of both and compare them. We also use RRClass
objects for the zone class. This makes sure the comparison is correct
one.
-----------------------------------------------------------------------
Summary of changes:
src/bin/xfrin/xfrin.py.in | 36 +++++++++++++++++++++---------------
src/bin/xfrin/xfrin_messages.mes | 3 +++
2 files changed, 24 insertions(+), 15 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/xfrin/xfrin.py.in b/src/bin/xfrin/xfrin.py.in
index 814695c..529843b 100755
--- a/src/bin/xfrin/xfrin.py.in
+++ b/src/bin/xfrin/xfrin.py.in
@@ -1550,24 +1550,30 @@ class Xfrin:
if is_default:
return
for d in datasources:
- if "class" in d:
- dclass = d["class"]
- else:
- dclass = "IN"
- if d["type"].lower() == "memory" and dclass.lower() == zone_class.to_text().lower():
+ try:
+ if "class" in d:
+ dclass = RRClass(d["class"])
+ else:
+ dclass = RRClass("IN")
+ except InvalidRRType as err:
+ logger.info(XFRIN_AUTH_CONFIG_ERROR, str(err))
+ continue
+
+ if d["type"].lower() == "memory" and dclass == zone_class:
for zone in d["zones"]:
- # Remove trailing periods
- n1 = zone["origin"]
- if n1[-1] == '.':
- n1 = n1[:-1]
- n2 = zone_name.to_text()
- if n2[-1] == '.':
- n2 = n2[:-1]
-
- if zone["filetype"].lower() == "sqlite3" and n1.lower() == n2.lower():
- param = {"origin": n1,
+ if "filetype" not in zone:
+ continue
+ try:
+ name = Name(zone["origin"])
+ except (EmptyLabel, TooLongLabel, BadLabelType, BadEscape, TooLongName, IncompleteName):
+ logger.info(XFRIN_AUTH_CONFIG_ERROR, str(err))
+ continue
+
+ if zone["filetype"].lower() == "sqlite3" and name == zone_name:
+ param = {"origin": zone_name.to_text(),
"class": zone_class.to_text(),
"datasrc": d["type"]}
+
logger.debug(DBG_XFRIN_TRACE, XFRIN_AUTH_LOADZONE,
param["origin"], param["class"], param["datasrc"])
diff --git a/src/bin/xfrin/xfrin_messages.mes b/src/bin/xfrin/xfrin_messages.mes
index 42a313b..388159e 100644
--- a/src/bin/xfrin/xfrin_messages.mes
+++ b/src/bin/xfrin/xfrin_messages.mes
@@ -121,6 +121,9 @@ likely means that the msgq daemon has quit or was killed.
There was a problem sending a message to b10-auth. This most likely
means that the msgq daemon has quit or was killed.
+% XFRIN_AUTH_CONFIG_ERROR Error parsing Auth configuration: %1
+There was an error when parsing Auth configuration.
+
% XFRIN_AUTH_LOADZONE sending Auth loadzone for origin=%1, class=%2, datasrc=%3
There was a successful zone transfer, and the zone is served by b10-auth
in the in-memory data source using sqlite3 as a backend. We send the
More information about the bind10-changes
mailing list