From: James Brister Date: Tue, 25 Jul 2000 17:55:43 +0000 (+0000) Subject: 348. [func] New named.conf boolean values 'glue-from-auth' and X-Git-Tag: v9.2.0a1^10~31 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=d4ab9cd94f0fe0cf24ba36d21240215ae648c8d5;p=thirdparty%2Fbind9.git 348. [func] New named.conf boolean values 'glue-from-auth' and 'glue-from-cache' now supported in view and global options statement. --- diff --git a/CHANGES b/CHANGES index 31e1b05d29e..ba4358db628 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ + 348. [func] New named.conf boolean values 'glue-from-auth' and + 'glue-from-cache' now supported in view and global + options statement. + 347. [bug] Don't crash if when an argument is left off options in dig. diff --git a/bin/tests/named.conf b/bin/tests/named.conf index 2e67ce21c2d..60f62b17a23 100644 --- a/bin/tests/named.conf +++ b/bin/tests/named.conf @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: named.conf,v 1.42 2000/07/21 21:24:55 brister Exp $ */ +/* $Id: named.conf,v 1.43 2000/07/25 17:55:35 brister Exp $ */ /* * This is a worthless, nonrunnable example of a named.conf file that has @@ -34,6 +34,9 @@ // watch out for ";" -- it's important! options { + glue-from-auth true; + glue-from-cache false; + version "my version string"; random-device "/dev/random"; random-seed-file "/random/seed/file"; @@ -262,6 +265,8 @@ view "test-view" in { sig-validity-interval 45; max-cache-size 100000; allow-query { 10.0.0.30;}; + glue-from-cache false; + glue-from-auth no; match-clients { 10.0.0.1 ; }; check-names master warn; check-names slave ignore; diff --git a/lib/dns/config/confctx.c b/lib/dns/config/confctx.c index 14a93258cd2..b6e26cbc3be 100644 --- a/lib/dns/config/confctx.c +++ b/lib/dns/config/confctx.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: confctx.c,v 1.74 2000/07/24 22:59:34 explorer Exp $ */ +/* $Id: confctx.c,v 1.75 2000/07/25 17:55:37 brister Exp $ */ #include @@ -981,6 +981,8 @@ dns_c_ctx_optionsprint(FILE *fp, int indent, dns_c_options_t *options) PRINT_AS_BOOLEAN(request_ixfr, "request-ixfr"); PRINT_AS_BOOLEAN(provide_ixfr, "provide-ixfr"); PRINT_AS_BOOLEAN(treat_cr_as_space, "treat-cr-as-space"); + PRINT_AS_BOOLEAN(glue_from_auth, "glue-from-auth"); + PRINT_AS_BOOLEAN(glue_from_cache, "glue-from-cache"); if (options->transfer_format != NULL) { dns_c_printtabs(fp, indent + 1); @@ -1496,6 +1498,8 @@ dns_c_ctx_optionsnew(isc_mem_t *mem, dns_c_options_t **options) opts->request_ixfr = NULL; opts->provide_ixfr = NULL; opts->treat_cr_as_space = NULL; + opts->glue_from_auth = NULL; + opts->glue_from_cache = NULL; opts->transfer_source = NULL; opts->transfer_source_v6 = NULL; @@ -1602,7 +1606,8 @@ dns_c_ctx_optionsdelete(dns_c_options_t **opts) FREEFIELD(request_ixfr); FREEFIELD(provide_ixfr); FREEFIELD(treat_cr_as_space); - + FREEFIELD(glue_from_cache); + FREEFIELD(glue_from_auth); FREEFIELD(port); @@ -1969,6 +1974,16 @@ SETBOOL(treatcrasspace, treat_cr_as_space) UNSETBOOL(treatcrasspace, treat_cr_as_space) +GETBOOL(gluefromauth, glue_from_auth) +SETBOOL(gluefromauth, glue_from_auth) +UNSETBOOL(gluefromauth, glue_from_auth) + + +GETBOOL(gluefromcache, glue_from_cache) +SETBOOL(gluefromcache, glue_from_cache) +UNSETBOOL(gluefromcache, glue_from_cache) + + GETSOCKADDR(transfersource, transfer_source) SETSOCKADDR(transfersource, transfer_source) UNSETSOCKADDR(transfersource, transfer_source) diff --git a/lib/dns/config/confparser.y b/lib/dns/config/confparser.y index b5704b6c881..6b75756975c 100644 --- a/lib/dns/config/confparser.y +++ b/lib/dns/config/confparser.y @@ -16,7 +16,7 @@ * SOFTWARE. */ -/* $Id: confparser.y,v 1.105 2000/07/24 23:32:31 gson Exp $ */ +/* $Id: confparser.y,v 1.106 2000/07/25 17:55:39 brister Exp $ */ #include @@ -283,6 +283,8 @@ static isc_boolean_t int_too_big(isc_uint32_t base, isc_uint32_t mult); %token L_FIRST %token L_FORWARD %token L_FORWARDERS +%token L_GLUE_FROM_AUTH +%token L_GLUE_FROM_CACHE %token L_GRANT %token L_GROUP %token L_HAS_OLD_CLIENTS @@ -886,6 +888,24 @@ option: /* Empty */ YYABORT; } } + | L_GLUE_FROM_CACHE yea_or_nay + { + tmpres = dns_c_ctx_setgluefromcache(currcfg, $2); + if (tmpres == ISC_R_EXISTS) { + parser_error(ISC_FALSE, + "cannot redefine glue-from-cache"); + YYABORT; + } + } + | L_GLUE_FROM_AUTH yea_or_nay + { + tmpres = dns_c_ctx_setgluefromauth(currcfg, $2); + if (tmpres == ISC_R_EXISTS) { + parser_error(ISC_FALSE, + "cannot redefine glue-from-auth"); + YYABORT; + } + } | L_LISTEN_ON maybe_port L_LBRACE address_match_list L_RBRACE { if ($4 == NULL) { @@ -3663,6 +3683,40 @@ view_option: L_FORWARD zone_forward_opt YYABORT; } } + | L_GLUE_FROM_CACHE yea_or_nay + { + dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg); + + INSIST(view != NULL); + + tmpres = dns_c_view_setgluefromcache(view, $2); + if (tmpres == ISC_R_EXISTS) { + parser_error(ISC_FALSE, + "cannot redefine view glue-from-cache"); + YYABORT; + } else if (tmpres != ISC_R_SUCCESS) { + parser_error(ISC_FALSE, + "failed to set view glue-from-cache"); + YYABORT; + } + } + | L_GLUE_FROM_AUTH yea_or_nay + { + dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg); + + INSIST(view != NULL); + + tmpres = dns_c_view_setgluefromauth(view, $2); + if (tmpres == ISC_R_EXISTS) { + parser_error(ISC_FALSE, + "cannot redefine view glue-from-auth"); + YYABORT; + } else if (tmpres != ISC_R_SUCCESS) { + parser_error(ISC_FALSE, + "failed to set view glue-from-auth"); + YYABORT; + } + } | L_QUERY_SOURCE query_source_v4 { dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg); @@ -5181,19 +5235,18 @@ static struct token keyword_tokens [] = { { "algorithm", L_ALGID }, { "allow", L_ALLOW }, { "allow-query", L_ALLOW_QUERY }, - { "allow-transfer", L_ALLOW_TRANSFER }, { "allow-recursion", L_ALLOW_RECURSION }, + { "allow-transfer", L_ALLOW_TRANSFER }, { "allow-update", L_ALLOW_UPDATE }, { "allow-update-forwarding", L_ALLOW_UPDATE_FORWARDING }, { "also-notify", L_ALSO_NOTIFY }, { "auth-nxdomain", L_AUTH_NXDOMAIN }, { "blackhole", L_BLACKHOLE }, { "bogus", L_BOGUS }, - { "max-cache-size", L_MAX_CACHE_SIZE }, { "category", L_CATEGORY }, - { "class", L_CLASS }, { "channel", L_CHANNEL }, { "check-names", L_CHECK_NAMES }, + { "class", L_CLASS }, { "cleaning-interval", L_CLEAN_INTERVAL }, { "controls", L_CONTROLS }, { "coresize", L_CORESIZE }, @@ -5202,12 +5255,14 @@ static struct token keyword_tokens [] = { { "deallocate-on-exit", L_DEALLOC_ON_EXIT }, { "debug", L_DEBUG }, { "default", L_DEFAULT }, + { "deny", L_DENY }, { "dialup", L_DIALUP }, { "directory", L_DIRECTORY }, { "dump-file", L_DUMP_FILE }, { "dynamic", L_DYNAMIC }, { "enable-zone", L_ENABLE_ZONE }, { "expert-mode", L_EXPERT_MODE }, + { "explicit", L_EXPLICIT }, { "fail", L_FAIL }, { "fake-iquery", L_FAKE_IQUERY }, { "false", L_FALSE }, @@ -5217,11 +5272,9 @@ static struct token keyword_tokens [] = { { "first", L_FIRST }, { "forward", L_FORWARD }, { "forwarders", L_FORWARDERS }, + { "glue-from-auth", L_GLUE_FROM_AUTH }, + { "glue-from-cache", L_GLUE_FROM_CACHE }, { "grant", L_GRANT }, - { "deny", L_DENY }, - { "subdomain", L_SUBDOMAIN }, - { "self", L_SELF }, - { "wildcard", L_WILDCARD }, { "group", L_GROUP }, { "has-old-clients", L_HAS_OLD_CLIENTS }, { "heartbeat-interval", L_HEARTBEAT }, @@ -5247,18 +5300,19 @@ static struct token keyword_tokens [] = { { "master", L_MASTER }, { "masters", L_MASTERS }, { "match-clients", L_MATCH_CLIENTS }, - { "max-ixfr-log-size", L_MAX_LOG_SIZE_IXFR }, + { "max-cache-size", L_MAX_CACHE_SIZE }, { "max-cache-ttl", L_MAX_CACHE_TTL }, + { "max-ixfr-log-size", L_MAX_LOG_SIZE_IXFR }, { "max-ncache-ttl", L_MAX_NCACHE_TTL }, - { "max-transfer-time-in", L_MAX_TRANSFER_TIME_IN }, - { "max-transfer-time-out", L_MAX_TRANSFER_TIME_OUT }, { "max-transfer-idle-in", L_MAX_TRANSFER_IDLE_IN }, { "max-transfer-idle-out", L_MAX_TRANSFER_IDLE_OUT }, + { "max-transfer-time-in", L_MAX_TRANSFER_TIME_IN }, + { "max-transfer-time-out", L_MAX_TRANSFER_TIME_OUT }, { "maximal", L_MAXIMAL }, { "memstatistics-file", L_MEMSTATS_FILE }, - { "multiple-cnames", L_MULTIPLE_CNAMES }, { "min-roots", L_MIN_ROOTS }, { "minimal", L_MINIMAL }, + { "multiple-cnames", L_MULTIPLE_CNAMES }, { "name", L_NAME }, { "named-xfer", L_NAMED_XFER }, { "no", L_NO }, @@ -5266,8 +5320,8 @@ static struct token keyword_tokens [] = { { "null", L_NULL_OUTPUT }, { "one-answer", L_ONE_ANSWER }, { "only", L_ONLY }, - { "order", L_ORDER }, { "options", L_OPTIONS }, + { "order", L_ORDER }, { "owner", L_OWNER }, { "perm", L_PERM }, { "pid-file", L_PIDFILE }, @@ -5281,15 +5335,16 @@ static struct token keyword_tokens [] = { { "query-source-v6", L_QUERY_SOURCE_V6 }, { "random-device", L_RANDOM_DEVICE }, { "random-seed-file", L_RANDOM_SEED_FILE }, - { "request-ixfr", L_REQUEST_IXFR }, - { "rfc2308-type1", L_RFC2308_TYPE1 }, - { "rrset-order", L_RRSET_ORDER }, { "recursion", L_RECURSION }, { "recursive-clients", L_RECURSIVE_CLIENTS }, + { "request-ixfr", L_REQUEST_IXFR }, { "response", L_RESPONSE }, + { "rfc2308-type1", L_RFC2308_TYPE1 }, + { "rrset-order", L_RRSET_ORDER }, { "secret", L_SECRET }, - { "server", L_SERVER }, + { "self", L_SELF }, { "serial-queries", L_SERIAL_QUERIES }, + { "server", L_SERVER }, { "severity", L_SEVERITY }, { "sig-validity-interval", L_SIG_VALIDITY_INTERVAL }, { "size", L_SIZE }, @@ -5300,11 +5355,12 @@ static struct token keyword_tokens [] = { { "statistics-interval", L_STATS_INTERVAL }, { "stderr", L_STDERR }, { "stub", L_STUB }, + { "subdomain", L_SUBDOMAIN }, { "support-ixfr", L_SUPPORT_IXFR }, { "syslog", L_SYSLOG }, { "tcp-clients", L_TCP_CLIENTS }, - { "tkey-domain", L_TKEY_DOMAIN }, { "tkey-dhkey", L_TKEY_DHKEY }, + { "tkey-domain", L_TKEY_DOMAIN }, { "topology", L_TOPOLOGY }, { "transfer-format", L_TRANSFER_FORMAT }, { "transfer-source", L_TRANSFER_SOURCE }, @@ -5326,9 +5382,9 @@ static struct token keyword_tokens [] = { { "versions", L_VERSIONS }, { "view", L_VIEW }, { "warn", L_WARN }, + { "wildcard", L_WILDCARD }, { "yes", L_YES }, { "zone", L_ZONE }, - { "explicit", L_EXPLICIT }, { NULL, 0 } }; diff --git a/lib/dns/config/confview.c b/lib/dns/config/confview.c index 0f4231f16eb..9e9bf2eb482 100644 --- a/lib/dns/config/confview.c +++ b/lib/dns/config/confview.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: confview.c,v 1.37 2000/07/24 22:59:37 explorer Exp $ */ +/* $Id: confview.c,v 1.38 2000/07/25 17:55:40 brister Exp $ */ #include @@ -474,6 +474,8 @@ dns_c_view_new(isc_mem_t *mem, const char *name, dns_rdataclass_t viewclass, view->fetch_glue = NULL; view->notify = NULL; view->rfc2308_type1 = NULL; + view->glue_from_cache = NULL; + view->glue_from_auth = NULL; view->transfer_source = NULL; view->transfer_source_v6 = NULL; @@ -665,6 +667,8 @@ dns_c_view_print(FILE *fp, int indent, dns_c_view_t *view) { PRINT_AS_BOOLEAN(fetch_glue, "fetch-glue"); PRINT_AS_BOOLEAN(notify, "notify"); PRINT_AS_BOOLEAN(rfc2308_type1, "rfc2308-type1"); + PRINT_AS_BOOLEAN(glue_from_auth, "glue-from-auth"); + PRINT_AS_BOOLEAN(glue_from_cache, "glue-from-cache"); PRINT_IP(transfer_source, "transfer-source"); @@ -802,6 +806,8 @@ dns_c_view_delete(dns_c_view_t **viewptr) { FREEFIELD(fetch_glue); FREEFIELD(notify); FREEFIELD(rfc2308_type1); + FREEFIELD(glue_from_auth); + FREEFIELD(glue_from_cache); FREEFIELD(transfer_source); FREEFIELD(transfer_source_v6); @@ -1469,6 +1475,14 @@ SETBOOL(rfc2308type1, rfc2308_type1) GETBOOL(rfc2308type1, rfc2308_type1) UNSETBOOL(rfc2308type1, rfc2308_type1) +SETBOOL(gluefromcache, glue_from_cache) +GETBOOL(gluefromcache, glue_from_cache) +UNSETBOOL(gluefromcache, glue_from_cache) + +SETBOOL(gluefromauth, glue_from_auth) +GETBOOL(gluefromauth, glue_from_auth) +UNSETBOOL(gluefromauth, glue_from_auth) + GETSOCKADDR(transfersource, transfer_source) SETSOCKADDR(transfersource, transfer_source) UNSETSOCKADDR(transfersource, transfer_source) diff --git a/lib/dns/include/dns/confctx.h b/lib/dns/include/dns/confctx.h index 25f3899bd10..e329ec8f2d2 100644 --- a/lib/dns/include/dns/confctx.h +++ b/lib/dns/include/dns/confctx.h @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: confctx.h,v 1.44 2000/07/24 22:59:39 explorer Exp $ */ +/* $Id: confctx.h,v 1.45 2000/07/25 17:55:42 brister Exp $ */ #ifndef DNS_CONFCTX_H #define DNS_CONFCTX_H 1 @@ -167,6 +167,8 @@ struct dns_c_options { isc_boolean_t *request_ixfr; isc_boolean_t *provide_ixfr; isc_boolean_t *treat_cr_as_space; + isc_boolean_t *glue_from_cache; + isc_boolean_t *glue_from_auth; isc_sockaddr_t *transfer_source; isc_sockaddr_t *transfer_source_v6; @@ -585,6 +587,20 @@ isc_result_t dns_c_ctx_gettreatcrasspace(dns_c_ctx_t *cfg, isc_boolean_t *retval); +isc_result_t dns_c_ctx_getgluefromcache(dns_c_ctx_t *cfg, + isc_boolean_t *retval); +isc_result_t dns_c_ctx_setgluefromcache(dns_c_ctx_t *cfg, + isc_boolean_t newval); +isc_result_t dns_c_ctx_unsetgluefromcache(dns_c_ctx_t *ctx); + + +isc_result_t dns_c_ctx_getgluefromauth(dns_c_ctx_t *cfg, + isc_boolean_t *retval); +isc_result_t dns_c_ctx_setgluefromauth(dns_c_ctx_t *cfg, + isc_boolean_t newval); +isc_result_t dns_c_ctx_unsetgluefromauth(dns_c_ctx_t *ctx); + + isc_result_t dns_c_ctx_unsettreatcrasspace(dns_c_ctx_t *cfg); isc_result_t dns_c_ctx_settransfersource(dns_c_ctx_t *ctx, isc_sockaddr_t transfer_source); diff --git a/lib/dns/include/dns/confview.h b/lib/dns/include/dns/confview.h index 44719150b92..9ec7ca1a905 100644 --- a/lib/dns/include/dns/confview.h +++ b/lib/dns/include/dns/confview.h @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: confview.h,v 1.31 2000/07/24 22:59:41 explorer Exp $ */ +/* $Id: confview.h,v 1.32 2000/07/25 17:55:43 brister Exp $ */ #ifndef DNS_CONFVIEW_H #define DNS_CONFVIEW_H 1 @@ -124,6 +124,8 @@ struct dns_c_view { isc_boolean_t *fetch_glue; isc_boolean_t *notify; isc_boolean_t *rfc2308_type1; + isc_boolean_t *glue_from_auth; + isc_boolean_t *glue_from_cache; isc_sockaddr_t *query_source; isc_sockaddr_t *query_source_v6;