diff options
| author | 2003-11-18 14:14:04 +0000 | |
|---|---|---|
| committer | 2003-11-18 14:14:04 +0000 | |
| commit | 3dee7a5ac7752712c6d65bed4fce5a0337bbaa09 (patch) | |
| tree | 3a006eafb779ce1fb8162897fd14ccd92524c4ac /usr.sbin/bind/lib/isccfg/parser.c | |
| parent | use bn_asm_vax.S (from netbsd); test + ok by miod (diff) | |
| download | wireguard-openbsd-3dee7a5ac7752712c6d65bed4fce5a0337bbaa09.tar.xz wireguard-openbsd-3dee7a5ac7752712c6d65bed4fce5a0337bbaa09.zip | |
update to BIND v9.2.3. ok todd@
Diffstat (limited to 'usr.sbin/bind/lib/isccfg/parser.c')
| -rw-r--r-- | usr.sbin/bind/lib/isccfg/parser.c | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/usr.sbin/bind/lib/isccfg/parser.c b/usr.sbin/bind/lib/isccfg/parser.c index 88acaaf6148..c93af6f7d44 100644 --- a/usr.sbin/bind/lib/isccfg/parser.c +++ b/usr.sbin/bind/lib/isccfg/parser.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $ISC: parser.c,v 1.70.2.14.4.2 2003/02/17 07:05:10 marka Exp $ */ +/* $ISC: parser.c,v 1.70.2.22 2003/09/19 13:41:36 marka Exp $ */ #include <config.h> @@ -855,6 +855,17 @@ options_clauses[] = { { NULL, NULL, 0 } }; + +static cfg_type_t cfg_type_namelist = { + "namelist", parse_bracketed_list, print_bracketed_list, + &cfg_rep_list, &cfg_type_qstring }; + +static keyword_type_t exclude_kw = { "exclude", &cfg_type_namelist }; + +static cfg_type_t cfg_type_optional_exclude = { + "optional_exclude", parse_optional_keyvalue, print_keyvalue, + &cfg_rep_list, &exclude_kw }; + /* * Clauses that can be found within the 'view' statement, * with defaults in the 'options' statement. @@ -891,6 +902,7 @@ view_clauses[] = { { "check-names", &cfg_type_checknames, CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_NOTIMP }, { "cache-file", &cfg_type_qstring, 0 }, + { "root-delegation-only", &cfg_type_optional_exclude, 0 }, { NULL, NULL, 0 } }; @@ -1201,7 +1213,8 @@ create_tuple(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) { return (ISC_R_SUCCESS); cleanup: - CLEANUP_OBJ(obj); + if (obj != NULL) + isc_mem_put(pctx->mctx, obj, sizeof(*obj)); return (result); } @@ -1667,6 +1680,10 @@ parse_sizeval(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) { UNUSED(type); CHECK(cfg_gettoken(pctx, 0)); + if (pctx->token.type != isc_tokentype_string) { + result = ISC_R_UNEXPECTEDTOKEN; + goto cleanup; + } CHECK(parse_unitstring(pctx->token.value.as_pointer, &val)); CHECK(create_cfgobj(pctx, &cfg_type_uint64, &obj)); @@ -1776,7 +1793,7 @@ create_string(cfg_parser_t *pctx, const char *contents, const cfg_type_t *type, obj->value.string.length = len; obj->value.string.base = isc_mem_get(pctx->mctx, len + 1); if (obj->value.string.base == 0) { - CLEANUP_OBJ(obj); + isc_mem_put(pctx->mctx, obj, sizeof(*obj)); return (ISC_R_NOMEMORY); } memcpy(obj->value.string.base, contents, len); @@ -2109,24 +2126,26 @@ parse_list(cfg_parser_t *pctx, const cfg_type_t *listtype, cfg_obj_t **ret) cfg_obj_t *listobj = NULL; const cfg_type_t *listof = listtype->of; isc_result_t result; + cfg_listelt_t *elt = NULL; CHECK(create_list(pctx, listtype, &listobj)); for (;;) { - cfg_listelt_t *elt = NULL; - CHECK(cfg_peektoken(pctx, 0)); if (pctx->token.type == isc_tokentype_special && - pctx->token.value.as_char == '}') + pctx->token.value.as_char == /*{*/ '}') break; CHECK(parse_list_elt(pctx, listof, &elt)); CHECK(parse_semicolon(pctx)); ISC_LIST_APPEND(listobj->value.list, elt, link); + elt = NULL; } *ret = listobj; return (ISC_R_SUCCESS); cleanup: + if (elt != NULL) + free_list_elt(pctx, elt); CLEANUP_OBJ(listobj); return (result); } @@ -2429,7 +2448,6 @@ parse_symtab_elt(cfg_parser_t *pctx, const char *name, CHECK(isc_symtab_define(symtab, name, 1, symval, isc_symexists_reject)); - obj = NULL; return (ISC_R_SUCCESS); cleanup: @@ -2768,7 +2786,7 @@ token_addr(cfg_parser_t *pctx, unsigned int flags, isc_netaddr_t *na) { } } if ((flags & V4PREFIXOK) != 0 && - strlen(s) <= 15) { + strlen(s) <= 15U) { char buf[64]; int i; @@ -2827,7 +2845,7 @@ get_port(cfg_parser_t *pctx, unsigned int flags, in_port_t *port) { "expected port number or '*'"); return (ISC_R_UNEXPECTEDTOKEN); } - if (pctx->token.value.as_ulong >= 65536) { + if (pctx->token.value.as_ulong >= 65536U) { parser_error(pctx, LOG_NEAR, "port number out of range"); return (ISC_R_UNEXPECTEDTOKEN); @@ -3761,7 +3779,8 @@ create_map(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) { return (ISC_R_SUCCESS); cleanup: - CLEANUP_OBJ(obj); + if (obj != NULL) + isc_mem_put(pctx->mctx, obj, sizeof(*obj)); return (result); } |
