|
@@ -194,11 +194,12 @@ class XfroutSession(BaseRequestHandler):
|
|
|
|
|
|
|
|
|
def _zone_has_soa(self, zone):
|
|
|
- '''Judge if the zone has soa records.'''
|
|
|
- # In some sense, the soa defines a zone.
|
|
|
- # If the current NS is the authoritative NS for the specific zone,
|
|
|
- # we need to judge if the zone has soa records, if not, we consider
|
|
|
- # the zone has incomplete data, so xfrout can't serve for it.
|
|
|
+ '''Judge if the zone has an SOA record.'''
|
|
|
+ # In some sense, the SOA defines a zone.
|
|
|
+ # If the current name server has authority for the
|
|
|
+ # specific zone, we need to judge if the zone has an SOA record;
|
|
|
+ # if not, we consider the zone has incomplete data, so xfrout can't
|
|
|
+ # serve for it.
|
|
|
if sqlite3_ds.get_zone_soa(zone, self.server.get_db_file()):
|
|
|
return True
|
|
|
|
|
@@ -207,8 +208,8 @@ class XfroutSession(BaseRequestHandler):
|
|
|
def _zone_exist(self, zonename):
|
|
|
'''Judge if the zone is configured by config manager.'''
|
|
|
# Currently, if we find the zone in datasource successfully, we
|
|
|
- # consider the zone is configured, and the current NS are the
|
|
|
- # authoritative NS for the specific zone.
|
|
|
+ # consider the zone is configured, and the current name server has
|
|
|
+ # authority for the specific zone.
|
|
|
# TODO: should get zone's configuration from cfgmgr or other place
|
|
|
# in future.
|
|
|
return sqlite3_ds.zone_exist(zonename, self.server.get_db_file())
|
|
@@ -218,13 +219,13 @@ class XfroutSession(BaseRequestHandler):
|
|
|
TODO, Get zone's configuration from cfgmgr or some other place
|
|
|
eg. check allow_transfer setting,
|
|
|
'''
|
|
|
- # If the current NS isn't the authoritative name server for the
|
|
|
+ # If the current name server does not have authority for the
|
|
|
# zone, xfrout can't serve for it, return rcode NOTAUTH.
|
|
|
if not self._zone_exist(zone_name):
|
|
|
return Rcode.NOTAUTH()
|
|
|
|
|
|
- # If we are the authoritative name server for the zone, but fail
|
|
|
- # to find the zone's soa record in datasource, xfrout can't
|
|
|
+ # If we are an authoritative name server for the zone, but fail
|
|
|
+ # to find the zone's SOA record in datasource, xfrout can't
|
|
|
# provide zone transfer for it.
|
|
|
if not self._zone_has_soa(zone_name):
|
|
|
return Rcode.SERVFAIL()
|