[svn] commit: r1247 - in /trunk/src: bin/loadzone/b10-loadzone.py.in lib/python/isc/auth/master.py
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Mar 9 20:51:37 UTC 2010
Author: each
Date: Tue Mar 9 20:51:37 2010
New Revision: 1247
Log:
fix some loadzone bugs:
- -o option wasn't being used correctly
- SOA records MNAME and RNAME values need to have the origin appended
when they don't end in dot
Modified:
trunk/src/bin/loadzone/b10-loadzone.py.in
trunk/src/lib/python/isc/auth/master.py
Modified: trunk/src/bin/loadzone/b10-loadzone.py.in
==============================================================================
--- trunk/src/bin/loadzone/b10-loadzone.py.in (original)
+++ trunk/src/bin/loadzone/b10-loadzone.py.in Tue Mar 9 20:51:37 2010
@@ -45,6 +45,8 @@
if o in ("-d", "--dbfile"):
dbfile = a
elif o in ("-o", "--origin"):
+ if a[-1] != '.':
+ a += '.'
initial_origin = a
elif o in ("-h", "--help"):
usage()
@@ -68,7 +70,6 @@
exit(1)
try:
-
isc.auth.sqlite3_ds.load(dbfile, zone, isc.auth.master.zonedata, zf)
except Exception as e:
print("Error loading database: " + str(e))
Modified: trunk/src/lib/python/isc/auth/master.py
==============================================================================
--- trunk/src/lib/python/isc/auth/master.py (original)
+++ trunk/src/lib/python/isc/auth/master.py Tue Mar 9 20:51:37 2010
@@ -347,6 +347,7 @@
# openzone: open a zone master file, set initial origin, return descriptor
#########################################################################
def openzone(filename, initial_origin = ''):
+ global origin
try:
zf = open(filename, 'r')
except:
@@ -417,6 +418,15 @@
raise MasterFileError("Invalid " + rrtype + ": " + rdata)
if rdata[-1] != '.':
rdata += '.' + origin
+ if rrtype.lower() == 'soa':
+ soa = rdata.split()
+ if len(soa) < 2 or not isname(soa[0]) or not isname(soa[1]):
+ raise MasterFileError("Invalid " + rrtype + ": " + rdata)
+ if soa[0][-1] != '.':
+ soa[0] += '.' + origin
+ if soa[1][-1] != '.':
+ soa[1] += '.' + origin
+ rdata = ' '.join(soa)
if rrtype.lower() == 'mx':
mx = rdata.split()
if len(mx) != 2 or not isname(mx[1]):
More information about the bind10-changes
mailing list