2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-04 00:25:29 +00:00

728. [bug] Fix comment processing on master file directives.

[RT# 757]
This commit is contained in:
Mark Andrews
2001-02-07 13:24:19 +00:00
parent e618d503ba
commit e880677f63
2 changed files with 24 additions and 8 deletions

View File

@@ -1,3 +1,5 @@
728. [bug] Fix comment processing on master file directives.
[RT# 757]
727. [port] Work around OS bug where accept() succeeds but 727. [port] Work around OS bug where accept() succeeds but
fails to fill in the peer address of the accepted fails to fill in the peer address of the accepted

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: master.c,v 1.104 2001/02/01 21:29:40 marka Exp $ */ /* $Id: master.c,v 1.105 2001/02/07 13:24:19 marka Exp $ */
#include <config.h> #include <config.h>
@@ -688,6 +688,7 @@ load(dns_loadctx_t **ctxp) {
isc_boolean_t finish_origin = ISC_FALSE; isc_boolean_t finish_origin = ISC_FALSE;
isc_boolean_t finish_include = ISC_FALSE; isc_boolean_t finish_include = ISC_FALSE;
isc_boolean_t read_till_eol = ISC_FALSE; isc_boolean_t read_till_eol = ISC_FALSE;
isc_boolean_t expect_eol = ISC_FALSE;
isc_boolean_t initialws; isc_boolean_t initialws;
char *include_file = NULL; char *include_file = NULL;
isc_token_t token; isc_token_t token;
@@ -720,7 +721,6 @@ load(dns_loadctx_t **ctxp) {
char *gtype = NULL; char *gtype = NULL;
char *rhs = NULL; char *rhs = NULL;
ctx = *ctxp; ctx = *ctxp;
REQUIRE(DNS_LCTX_VALID(ctx)); REQUIRE(DNS_LCTX_VALID(ctx));
callbacks = ctx->callbacks; callbacks = ctx->callbacks;
@@ -743,7 +743,8 @@ load(dns_loadctx_t **ctxp) {
do { do {
initialws = ISC_FALSE; initialws = ISC_FALSE;
GETTOKEN(ctx->lex, ISC_LEXOPT_INITIALWS, &token, ISC_TRUE); GETTOKEN(ctx->lex, expect_eol ? 0 : ISC_LEXOPT_INITIALWS,
&token, ISC_TRUE);
if (token.type == isc_tokentype_eof) { if (token.type == isc_tokentype_eof) {
if (read_till_eol) if (read_till_eol)
@@ -762,15 +763,28 @@ load(dns_loadctx_t **ctxp) {
CTX_COPYVAR(ctx, *ctxp, result); CTX_COPYVAR(ctx, *ctxp, result);
dns_loadctx_detach(&ctx); dns_loadctx_detach(&ctx);
ctx = *ctxp; ctx = *ctxp;
read_till_eol = ISC_TRUE; expect_eol = ISC_TRUE;
continue; continue;
} }
done = ISC_TRUE; done = ISC_TRUE;
continue; continue;
} }
if (token.type != isc_tokentype_eol && expect_eol) {
result = DNS_R_EXTRATOKEN;
if (MANYERRS(ctx, result)) {
SETRESULT(ctx, result);
LOGIT(result);
expect_eol = ISC_FALSE;
read_till_eol = ISC_TRUE;
continue;
} else if (result != ISC_R_SUCCESS)
goto log_and_cleanup;
}
if (token.type == isc_tokentype_eol) { if (token.type == isc_tokentype_eol) {
read_till_eol = ISC_FALSE; read_till_eol = ISC_FALSE;
expect_eol = ISC_FALSE;
continue; /* blank line */ continue; /* blank line */
} }
@@ -795,7 +809,7 @@ load(dns_loadctx_t **ctxp) {
if (strcasecmp(token.value.as_pointer, if (strcasecmp(token.value.as_pointer,
"$ORIGIN") == 0) { "$ORIGIN") == 0) {
GETTOKEN(ctx->lex, 0, &token, ISC_FALSE); GETTOKEN(ctx->lex, 0, &token, ISC_FALSE);
read_till_eol = ISC_TRUE; expect_eol = ISC_TRUE;
finish_origin = ISC_TRUE; finish_origin = ISC_TRUE;
} else if (strcasecmp(token.value.as_pointer, } else if (strcasecmp(token.value.as_pointer,
"$TTL") == 0) { "$TTL") == 0) {
@@ -821,7 +835,7 @@ load(dns_loadctx_t **ctxp) {
} }
ctx->default_ttl = ctx->ttl; ctx->default_ttl = ctx->ttl;
ctx->default_ttl_known = ISC_TRUE; ctx->default_ttl_known = ISC_TRUE;
read_till_eol = ISC_TRUE; expect_eol = ISC_TRUE;
continue; continue;
} else if (strcasecmp(token.value.as_pointer, } else if (strcasecmp(token.value.as_pointer,
"$INCLUDE") == 0) { "$INCLUDE") == 0) {
@@ -918,7 +932,7 @@ load(dns_loadctx_t **ctxp) {
dump_time = current_time; dump_time = current_time;
} }
ttl_offset = current_time - dump_time; ttl_offset = current_time - dump_time;
read_till_eol = ISC_TRUE; expect_eol = ISC_TRUE;
continue; continue;
} else if (strcasecmp(token.value.as_pointer, } else if (strcasecmp(token.value.as_pointer,
"$GENERATE") == 0) { "$GENERATE") == 0) {
@@ -990,7 +1004,7 @@ load(dns_loadctx_t **ctxp) {
SETRESULT(ctx, result); SETRESULT(ctx, result);
} else if (result != ISC_R_SUCCESS) } else if (result != ISC_R_SUCCESS)
goto insist_and_cleanup; goto insist_and_cleanup;
read_till_eol = ISC_TRUE; expect_eol = ISC_TRUE;
continue; continue;
} else if (strncasecmp(token.value.as_pointer, } else if (strncasecmp(token.value.as_pointer,
"$", 1) == 0) { "$", 1) == 0) {