From ff1db3c6dfb7756182ff3f024303b721f18e7649 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Tue, 5 Dec 2000 22:19:35 +0000 Subject: [PATCH] Make sig-validity-interval a number of days, like the documentation says. --- lib/dns/config/confparser.y.dirty | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/dns/config/confparser.y.dirty b/lib/dns/config/confparser.y.dirty index a5e315ac4c..a7a677c95f 100644 --- a/lib/dns/config/confparser.y.dirty +++ b/lib/dns/config/confparser.y.dirty @@ -33,7 +33,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: confparser.y.dirty,v 1.36 2000/12/02 00:57:43 marka Exp $ */ +/* $Id: confparser.y.dirty,v 1.37 2000/12/05 22:19:35 bwelling Exp $ */ #include @@ -1423,7 +1423,13 @@ option: /* Empty */ } | L_SIG_VALIDITY_INTERVAL L_INTEGER { - tmpres = dns_c_ctx_setsigvalidityinterval(currcfg, $2); + if (int_too_big($2, 60 * 60 * 24)) { + parser_error(ISC_FALSE, + "integer value too big: %u", $2); + YYABORT; + } + tmpres = dns_c_ctx_setsigvalidityinterval(currcfg, + $2 * 60 * 60 * 24); if (tmpres == ISC_R_EXISTS) { parser_error(ISC_FALSE, "cannot redefine sig-validity-interval"); @@ -4510,7 +4516,13 @@ view_option: L_FORWARD zone_forward_opt INSIST(view != NULL); - tmpres = dns_c_view_setsigvalidityinterval(view, $2); + if (int_too_big($2, 60 * 60 * 24)) { + parser_error(ISC_FALSE, + "integer value too big: %u", $2); + YYABORT; + } + tmpres = dns_c_view_setsigvalidityinterval(view, + $2 * 60 * 60 * 24); if (tmpres == ISC_R_EXISTS) { parser_error(ISC_FALSE, "cannot redefine view " @@ -5534,7 +5546,13 @@ zone_option: L_FILE L_QSTRING INSIST(zone != NULL); - tmpres = dns_c_zone_setsigvalidityinterval(zone, $2); + if (int_too_big($2, 60 * 60 * 24)) { + parser_error(ISC_FALSE, + "integer value too big: %u", $2); + YYABORT; + } + tmpres = dns_c_zone_setsigvalidityinterval(zone, + $2 * 60 * 60 * 24); if (tmpres == ISC_R_EXISTS) { parser_error(ISC_FALSE, "cannot redefine zone "