mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
parent
1eec6885ab
commit
0f2ecf4b5c
7 changed files with 34 additions and 4 deletions
3
CHANGES
3
CHANGES
|
|
@ -1,3 +1,6 @@
|
|||
4207. [bug] Handle class mismatches with raw zone files.
|
||||
[RT #40746]
|
||||
|
||||
4206. [bug] contrib: fixed a possible NULL dereference in
|
||||
DLZ wildcard module. [RT #40745]
|
||||
|
||||
|
|
|
|||
|
|
@ -133,5 +133,13 @@ n=`expr $n + 1`
|
|||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
||||
echo "I:checking that raw zone with bad class is handled ($n)"
|
||||
ret=0
|
||||
$CHECKZONE -f raw example zones/bad-badclass.raw > test.out.$n 2>&1 && ret=1
|
||||
grep "failed: bad class" test.out.$n >/dev/null || ret=1
|
||||
n=`expr $n + 1`
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
||||
echo "I:exit status: $status"
|
||||
exit $status
|
||||
|
|
|
|||
1
bin/tests/system/checkzone/zones/.gitattributes
vendored
Normal file
1
bin/tests/system/checkzone/zones/.gitattributes
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
*.raw -text
|
||||
BIN
bin/tests/system/checkzone/zones/bad-badclass.raw
Normal file
BIN
bin/tests/system/checkzone/zones/bad-badclass.raw
Normal file
Binary file not shown.
|
|
@ -2385,6 +2385,10 @@ load_raw(dns_loadctx_t *lctx) {
|
|||
/* Construct RRset headers */
|
||||
dns_rdatalist_init(&rdatalist);
|
||||
rdatalist.rdclass = isc_buffer_getuint16(&target);
|
||||
if (lctx->zclass != rdatalist.rdclass) {
|
||||
result = DNS_R_BADCLASS;
|
||||
goto cleanup;
|
||||
}
|
||||
rdatalist.type = isc_buffer_getuint16(&target);
|
||||
rdatalist.covers = isc_buffer_getuint16(&target);
|
||||
rdatalist.ttl = isc_buffer_getuint32(&target);
|
||||
|
|
|
|||
|
|
@ -7118,13 +7118,14 @@ loading_addrdataset(void *arg, dns_name_t *name, dns_rdataset_t *rdataset) {
|
|||
isc_region_t region;
|
||||
rdatasetheader_t *newheader;
|
||||
|
||||
REQUIRE(rdataset->rdclass == rbtdb->common.rdclass);
|
||||
|
||||
/*
|
||||
* This routine does no node locking. See comments in
|
||||
* 'load' below for more information on loading and
|
||||
* locking.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* SOA records are only allowed at top of zone.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -292,6 +292,9 @@ axfr_putdata(dns_xfrin_ctx_t *xfr, dns_diffop_t op,
|
|||
|
||||
dns_difftuple_t *tuple = NULL;
|
||||
|
||||
if (rdata->rdclass != xfr->rdclass)
|
||||
return(DNS_R_BADCLASS);
|
||||
|
||||
CHECK(dns_zone_checknames(xfr->zone, name, rdata));
|
||||
CHECK(dns_difftuple_create(xfr->diff.mctx, op,
|
||||
name, ttl, rdata, &tuple));
|
||||
|
|
@ -376,8 +379,11 @@ ixfr_putdata(dns_xfrin_ctx_t *xfr, dns_diffop_t op,
|
|||
dns_name_t *name, dns_ttl_t ttl, dns_rdata_t *rdata)
|
||||
{
|
||||
isc_result_t result;
|
||||
|
||||
dns_difftuple_t *tuple = NULL;
|
||||
|
||||
if (rdata->rdclass != xfr->rdclass)
|
||||
return(DNS_R_BADCLASS);
|
||||
|
||||
if (op == DNS_DIFFOP_ADD)
|
||||
CHECK(dns_zone_checknames(xfr->zone, name, rdata));
|
||||
CHECK(dns_difftuple_create(xfr->diff.mctx, op,
|
||||
|
|
@ -1246,10 +1252,17 @@ xfrin_recv_done(isc_task_t *task, isc_event_t *ev) {
|
|||
dns_result_totext(result));
|
||||
|
||||
if (result != ISC_R_SUCCESS || msg->rcode != dns_rcode_noerror ||
|
||||
msg->opcode != dns_opcode_query ||msg->rdclass != xfr->rdclass ||
|
||||
(xfr->checkid && msg->id != xfr->id)) {
|
||||
if (result == ISC_R_SUCCESS)
|
||||
if (result == ISC_R_SUCCESS && msg->rcode != dns_rcode_noerror)
|
||||
result = ISC_RESULTCLASS_DNSRCODE + msg->rcode; /*XXX*/
|
||||
if (result == ISC_R_SUCCESS || result == DNS_R_NOERROR)
|
||||
else if (result == ISC_R_SUCCESS &&
|
||||
msg->opcode != dns_opcode_query)
|
||||
result = DNS_R_UNEXPECTEDOPCODE;
|
||||
else if (result == ISC_R_SUCCESS &&
|
||||
msg->rdclass != xfr->rdclass)
|
||||
result = DNS_R_BADCLASS;
|
||||
else if (result == ISC_R_SUCCESS || result == DNS_R_NOERROR)
|
||||
result = DNS_R_UNEXPECTEDID;
|
||||
if (xfr->reqtype == dns_rdatatype_axfr ||
|
||||
xfr->reqtype == dns_rdatatype_soa)
|
||||
|
|
|
|||
Loading…
Reference in a new issue