[svn] commit: r1214 - /trunk/src/lib/python/isc/auth/master.py
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Mar 8 20:04:57 UTC 2010
Author: each
Date: Mon Mar 8 20:04:56 2010
New Revision: 1214
Log:
PTR and MX need to add the origin to names that don't end in '.'
Modified:
trunk/src/lib/python/isc/auth/master.py
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 Mon Mar 8 20:04:56 2010
@@ -335,8 +335,8 @@
#########################################################################
def reset():
global defttl, origin
- defttl = -1
- origin=''
+ defttl = ''
+ origin = ''
#########################################################################
# openzone: open a zone master file, set initial origin, return descriptor
@@ -398,15 +398,22 @@
if rrclass.upper() != 'IN':
raise MasterFileError("CH and HS zones not supported")
- # add origin to rdata if necessary
- if rrtype.lower() in ('cname', 'dname', 'ns'):
+ if not ttl:
+ raise MasterFileError("No TTL specified; zone rejected")
+
+ # add origin to rdata containing names, if necessary
+ if rrtype.lower() in ('cname', 'dname', 'ns', 'ptr'):
if not isname(rdata):
raise MasterFileError("Invalid " + rrtype + ": " + rdata)
if rdata[-1] != '.':
rdata += '.' + origin
-
- if (ttl == -1):
- raise MasterFileError("No TTL specified; zone rejected")
+ if rrtype.lower() == 'mx':
+ mx = rdata.split()
+ if len(mx) != 2 or not isname(mx[1]):
+ raise MasterFileError("Invalid " + rrtype + ": " + rdata)
+ if mx[1][-1] != '.':
+ mx[1] += '.' + origin
+ rdata = ' '.join(mx)
yield (name, ttl, rrclass, rrtype, rdata)
More information about the bind10-changes
mailing list