diff options
Diffstat (limited to 'lib/isccfg/namedconf.c')
-rw-r--r-- | lib/isccfg/namedconf.c | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c index f80d34ba810bb..46afd168dbb42 100644 --- a/lib/isccfg/namedconf.c +++ b/lib/isccfg/namedconf.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: namedconf.c,v 1.131.8.1 2011-02-03 05:50:08 marka Exp $ */ +/* $Id: namedconf.c,v 1.131.8.4 2011-05-23 20:56:11 each Exp $ */ /*! \file */ @@ -542,8 +542,7 @@ static cfg_type_t cfg_type_bracketed_sockaddrlist = { &cfg_rep_list, &cfg_type_sockaddr }; -static const char *autodnssec_enums[] = { "allow", "maintain", "create", - "off", NULL }; +static const char *autodnssec_enums[] = { "allow", "maintain", "off", NULL }; static cfg_type_t cfg_type_autodnssec = { "autodnssec", cfg_parse_enum, cfg_print_ustring, cfg_doc_enum, &cfg_rep_string, &autodnssec_enums @@ -1131,6 +1130,24 @@ static cfg_type_t cfg_type_rpz = { * dnssec-lookaside */ +static void +print_lookaside(cfg_printer_t *pctx, const cfg_obj_t *obj) +{ + const cfg_obj_t *domain = obj->value.tuple[0]; + + if (domain->value.string.length == 4 && + strncmp(domain->value.string.base, "auto", 4) == 0) + cfg_print_cstr(pctx, "auto"); + else + cfg_print_tuple(pctx, obj); +} + +static void +doc_lookaside(cfg_printer_t *pctx, const cfg_type_t *type) { + UNUSED(type); + cfg_print_cstr(pctx, "( <string> trust-anchor <string> | auto )"); +} + static keyword_type_t trustanchor_kw = { "trust-anchor", &cfg_type_astring }; static cfg_type_t cfg_type_optional_trustanchor = { @@ -1145,7 +1162,7 @@ static cfg_tuplefielddef_t lookaside_fields[] = { }; static cfg_type_t cfg_type_lookaside = { - "lookaside", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple, + "lookaside", cfg_parse_tuple, print_lookaside, doc_lookaside, &cfg_rep_tuple, lookaside_fields }; @@ -2235,7 +2252,8 @@ static cfg_type_t cfg_type_controls_sockaddr = { * statement, which takes a single key with or without braces and semicolon. */ static isc_result_t -parse_server_key_kludge(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) +parse_server_key_kludge(cfg_parser_t *pctx, const cfg_type_t *type, + cfg_obj_t **ret) { isc_result_t result; isc_boolean_t braces = ISC_FALSE; @@ -2245,7 +2263,7 @@ parse_server_key_kludge(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t ** CHECK(cfg_peektoken(pctx, 0)); if (pctx->token.type == isc_tokentype_special && pctx->token.value.as_char == '{') { - result = cfg_gettoken(pctx, 0); + CHECK(cfg_gettoken(pctx, 0)); braces = ISC_TRUE; } |