diff --git a/lib/dns/include/dns/master.h b/lib/dns/include/dns/master.h index 23affd072b..f63e3cff89 100644 --- a/lib/dns/include/dns/master.h +++ b/lib/dns/include/dns/master.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: master.h,v 1.29 2001/01/09 21:53:01 bwelling Exp $ */ +/* $Id: master.h,v 1.30 2001/01/30 23:12:27 gson Exp $ */ #ifndef DNS_MASTER_H #define DNS_MASTER_H 1 @@ -30,8 +30,12 @@ #include -#define DNS_MASTER_AGETTL 0x01 /* Age the ttl based on $DATE. */ -#define DNS_MASTER_MANYERRORS 0x2 /* Continue processing on errors. */ +/* + * Flags to be passed in the 'options' argument in the functions below. + */ +#define DNS_MASTER_AGETTL 0x00000001 /* Age the ttl based on $DATE. */ +#define DNS_MASTER_MANYERRORS 0x00000002 /* Continue processing on errors. */ +#define DNS_MASTER_NOINCLUDE 0x00000004 /* Disallow $INCLUDE directives. */ ISC_LANG_BEGINDECLS diff --git a/lib/dns/master.c b/lib/dns/master.c index 9e6e0975a6..cd8b2c1139 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: master.c,v 1.102 2001/01/30 13:23:32 marka Exp $ */ +/* $Id: master.c,v 1.103 2001/01/30 23:12:26 gson Exp $ */ #include @@ -877,6 +877,15 @@ load(dns_loadctx_t **ctxp) { } else if (strcasecmp(token.value.as_pointer, "$INCLUDE") == 0) { COMMITALL; + if ((ctx->options & DNS_MASTER_NOINCLUDE) != 0) { + (callbacks->error)(callbacks, + "%s: %s:%lu: $INCLUDE not allowed", + "dns_master_load", + isc_lex_getsourcename(ctx->lex), + isc_lex_getsourceline(ctx->lex)); + result = DNS_R_REFUSED; + goto insist_and_cleanup; + } if (ttl_offset != 0) { (callbacks->error)(callbacks, "%s: %s:%lu: $INCLUDE "