mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-03 22:08:25 -04:00
4014. [bug] When including a master file origin_changed was
not being properly set leading to a potentially
spurious 'inherited owner' warning. [RT #37919]
This commit is contained in:
parent
aafd2f2637
commit
6444de08d1
7 changed files with 44 additions and 2 deletions
4
CHANGES
4
CHANGES
|
|
@ -1,3 +1,7 @@
|
|||
4014. [bug] When including a master file origin_changed was
|
||||
not being properly set leading to a potentially
|
||||
spurious 'inherited owner' warning. [RT #37919]
|
||||
|
||||
4013. [func] Add a new tcp-only option to server (config) /
|
||||
peer (struct) to use TCP transport to send
|
||||
queries (in place of UDP transport with a
|
||||
|
|
|
|||
|
|
@ -92,5 +92,29 @@ n=`expr $n + 1`
|
|||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
||||
echo "I:checking for no 'inherited owner' warning on '\$INCLUDE file' with no new \$ORIGIN ($n)"
|
||||
ret=0
|
||||
$CHECKZONE example zones/nowarn.inherited.owner.db > test.out1.$n 2>&1 || ret=1
|
||||
grep "inherited.owner" test.out1.$n > /dev/null && ret=1
|
||||
n=`expr $n + 1`
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
||||
echo "I:checking for 'inherited owner' warning on '\$ORIGIN + \$INCLUDE file' ($n)"
|
||||
ret=0
|
||||
$CHECKZONE example zones/warn.inherit.origin.db > test.out1.$n 2>&1 || ret=1
|
||||
grep "inherited.owner" test.out1.$n > /dev/null || ret=1
|
||||
n=`expr $n + 1`
|
||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
||||
echo "I:checking for 'inherited owner' warning on '\$INCLUDE file origin' ($n)"
|
||||
ret=0
|
||||
$CHECKZONE example zones/warn.inherited.owner.db > test.out1.$n 2>&1 || ret=1
|
||||
grep "inherited.owner" test.out1.$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/inherit.db
Normal file
1
bin/tests/system/checkzone/zones/inherit.db
Normal file
|
|
@ -0,0 +1 @@
|
|||
NS .
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
@ 0 IN SOA . . 0 0 0 0 0
|
||||
$INCLUDE "zones/inherit.db"
|
||||
3
bin/tests/system/checkzone/zones/warn.inherit.origin.db
Normal file
3
bin/tests/system/checkzone/zones/warn.inherit.origin.db
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
@ 0 IN SOA . . 0 0 0 0 0
|
||||
$ORIGIN @
|
||||
$INCLUDE "zones/inherit.db"
|
||||
2
bin/tests/system/checkzone/zones/warn.inherited.owner.db
Normal file
2
bin/tests/system/checkzone/zones/warn.inherited.owner.db
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
@ 0 IN SOA . . 0 0 0 0 0
|
||||
$INCLUDE "zones/inherit.db" @
|
||||
|
|
@ -526,6 +526,7 @@ incctx_create(isc_mem_t *mctx, dns_name_t *origin, dns_incctx_t **ictxp) {
|
|||
ictx->drop = ISC_FALSE;
|
||||
ictx->glue_line = 0;
|
||||
ictx->current_line = 0;
|
||||
ictx->origin_changed = ISC_TRUE;
|
||||
|
||||
*ictxp = ictx;
|
||||
return (ISC_R_SUCCESS);
|
||||
|
|
@ -1125,7 +1126,6 @@ load_text(dns_loadctx_t *lctx) {
|
|||
line = isc_lex_getsourceline(lctx->lex);
|
||||
source = isc_lex_getsourcename(lctx->lex);
|
||||
ictx = lctx->inc;
|
||||
EXPECTEOL;
|
||||
continue;
|
||||
}
|
||||
done = ISC_TRUE;
|
||||
|
|
@ -1215,7 +1215,6 @@ load_text(dns_loadctx_t *lctx) {
|
|||
token.type == isc_tokentype_eof) {
|
||||
if (token.type == isc_tokentype_eof)
|
||||
WARNUNEXPECTEDEOF(lctx->lex);
|
||||
isc_lex_ungettoken(lctx->lex, &token);
|
||||
/*
|
||||
* No origin field.
|
||||
*/
|
||||
|
|
@ -1434,6 +1433,7 @@ load_text(dns_loadctx_t *lctx) {
|
|||
}
|
||||
if (finish_include) {
|
||||
finish_include = ISC_FALSE;
|
||||
EXPECTEOL;
|
||||
result = pushfile(include_file, new_name, lctx);
|
||||
if (MANYERRS(lctx, result)) {
|
||||
SETRESULT(lctx, result);
|
||||
|
|
@ -1444,6 +1444,7 @@ load_text(dns_loadctx_t *lctx) {
|
|||
goto insist_and_cleanup;
|
||||
}
|
||||
ictx = lctx->inc;
|
||||
ictx->origin_changed = ISC_TRUE;
|
||||
source = isc_lex_getsourcename(lctx->lex);
|
||||
line = isc_lex_getsourceline(lctx->lex);
|
||||
POST(line);
|
||||
|
|
@ -2075,6 +2076,11 @@ pushfile(const char *master_file, dns_name_t *origin, dns_loadctx_t *lctx) {
|
|||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
/*
|
||||
* Push origin_changed.
|
||||
*/
|
||||
new->origin_changed = ictx->origin_changed;
|
||||
|
||||
/* Set current domain. */
|
||||
if (ictx->glue != NULL || ictx->current != NULL) {
|
||||
for (new_in_use = 0; new_in_use < NBUFS; new_in_use++)
|
||||
|
|
|
|||
Loading…
Reference in a new issue