424 [bug] notify_createmessage could trigger a REQUIRE failure
w/ two SOA records for the zone (illegal). [RT #279]
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,3 +1,5 @@
|
||||
424 [bug] notify_createmessage could trigger a REQUIRE failure
|
||||
w/ two SOA records for the zone (illegal). [RT #279]
|
||||
|
||||
423. [bug] When responding to a recusive query, errors that occur
|
||||
after following a CNAME should cause the query to fail.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: zone.c,v 1.201 2000/09/05 03:35:19 marka Exp $ */
|
||||
/* $Id: zone.c,v 1.202 2000/09/07 01:06:45 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -3405,23 +3405,23 @@ notify_createmessage(dns_zone_t *zone, unsigned int flags,
|
||||
|
||||
result = dns_message_gettempname(message, &tempname);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto done;
|
||||
goto soa_cleanup;
|
||||
result = dns_message_gettemprdata(message, &temprdata);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto done;
|
||||
goto soa_cleanup;
|
||||
result = dns_message_gettemprdataset(message, &temprdataset);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto done;
|
||||
goto soa_cleanup;
|
||||
result = dns_message_gettemprdatalist(message, &temprdatalist);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto done;
|
||||
goto soa_cleanup;
|
||||
|
||||
dns_name_init(tempname, NULL);
|
||||
dns_name_clone(&zone->origin, tempname);
|
||||
dns_db_currentversion(zone->db, &version);
|
||||
result = dns_db_findnode(zone->db, tempname, ISC_FALSE, &node);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto done;
|
||||
goto soa_cleanup;
|
||||
|
||||
dns_rdataset_init(&rdataset);
|
||||
result = dns_db_findrdataset(zone->db, node, version,
|
||||
@@ -3429,16 +3429,16 @@ notify_createmessage(dns_zone_t *zone, unsigned int flags,
|
||||
dns_rdatatype_none, 0, &rdataset,
|
||||
NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto done;
|
||||
goto soa_cleanup;
|
||||
result = dns_rdataset_first(&rdataset);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto done;
|
||||
goto soa_cleanup;
|
||||
dns_rdata_init(&rdata);
|
||||
dns_rdataset_current(&rdataset, &rdata);
|
||||
dns_rdata_toregion(&rdata, &r);
|
||||
result = isc_buffer_allocate(zone->mctx, &b, r.length);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto done;
|
||||
goto soa_cleanup;
|
||||
isc_buffer_putmem(b, r.base, r.length);
|
||||
isc_buffer_usedregion(b, &r);
|
||||
dns_rdata_init(temprdata);
|
||||
@@ -3447,7 +3447,7 @@ notify_createmessage(dns_zone_t *zone, unsigned int flags,
|
||||
result = dns_rdataset_next(&rdataset);
|
||||
dns_rdataset_disassociate(&rdataset);
|
||||
if (result != ISC_R_NOMORE)
|
||||
goto done;
|
||||
goto soa_cleanup;
|
||||
temprdatalist->rdclass = rdata.rdclass;
|
||||
temprdatalist->type = rdata.type;
|
||||
temprdatalist->covers = 0;
|
||||
@@ -3458,7 +3458,7 @@ notify_createmessage(dns_zone_t *zone, unsigned int flags,
|
||||
dns_rdataset_init(temprdataset);
|
||||
result = dns_rdatalist_tordataset(temprdatalist, temprdataset);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto done;
|
||||
goto soa_cleanup;
|
||||
|
||||
ISC_LIST_APPEND(tempname->list, temprdataset, link);
|
||||
dns_message_addname(message, tempname, DNS_SECTION_ANSWER);
|
||||
@@ -3467,12 +3467,7 @@ notify_createmessage(dns_zone_t *zone, unsigned int flags,
|
||||
temprdata = NULL;
|
||||
tempname = NULL;
|
||||
|
||||
done:
|
||||
*messagep = message;
|
||||
message = NULL;
|
||||
result = ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
soa_cleanup:
|
||||
if (node != NULL)
|
||||
dns_db_detachnode(zone->db, &node);
|
||||
if (version != NULL)
|
||||
@@ -3485,6 +3480,17 @@ notify_createmessage(dns_zone_t *zone, unsigned int flags,
|
||||
dns_message_puttemprdataset(message, &temprdataset);
|
||||
if (temprdatalist != NULL)
|
||||
dns_message_puttemprdatalist(message, &temprdatalist);
|
||||
|
||||
done:
|
||||
*messagep = message;
|
||||
message = NULL;
|
||||
result = ISC_R_SUCCESS;
|
||||
|
||||
cleanup:
|
||||
if (tempname != NULL)
|
||||
dns_message_puttempname(message, &tempname);
|
||||
if (temprdataset != NULL)
|
||||
dns_message_puttemprdataset(message, &temprdataset);
|
||||
if (message != NULL)
|
||||
dns_message_destroy(&message);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user