From: Mark Andrews Date: Thu, 30 Aug 2001 05:23:00 +0000 (+0000) Subject: journal-size can now be set from named.conf X-Git-Tag: v9.2.2rc1^3~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc0a5f714231709409b9e1b85f0f97ae50854451;p=thirdparty%2Fbind9.git journal-size can now be set from named.conf --- diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index 74cdd90216f..83b798bc559 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -15,12 +15,13 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zoneconf.c,v 1.87 2001/08/07 01:58:58 marka Exp $ */ +/* $Id: zoneconf.c,v 1.88 2001/08/30 05:22:58 marka Exp $ */ #include #include #include +#include #include /* Required for HP/UX (and others?) */ #include @@ -313,6 +314,7 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig, dns_dialuptype_t dialup = dns_dialuptype_no; dns_zonetype_t ztype; int i; + isc_int32_t journal_size; i = 0; if (zconfig != NULL) { @@ -474,6 +476,33 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig, result = ns_config_get(maps, "max-transfer-idle-out", &obj); INSIST(result == ISC_R_SUCCESS); dns_zone_setidleout(zone, cfg_obj_asuint32(obj) * 60); + + obj = NULL; + result = ns_config_get(maps, "journal-size", &obj); + if (result == ISC_R_SUCCESS) { + dns_zone_setjournalsize(zone, -1); + if (cfg_obj_isstring(obj)) { + const char *str = cfg_obj_asstring(obj); + if (strcasecmp(str, "unlimited") == 0) + journal_size = ISC_UINT32_MAX/2; + else + journal_size = -1; + } else { + isc_resourcevalue_t value; + value = cfg_obj_asuint64(obj); + if (value > ISC_UINT32_MAX/2) { + cfg_obj_log(obj, ns_g_lctx, + ISC_LOG_ERROR, + "'journal-size " + "%" ISC_PRINT_QUADFORMAT "d' is too large", + value); + RETERR(ISC_R_RANGE); + } + journal_size = (isc_uint32_t)value; + } + } else + journal_size = -1; + dns_zone_setjournalsize(zone,journal_size); } /* diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index 5c49e7e317d..3f1fae7f45c 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: parser.c,v 1.70 2001/08/08 20:52:34 gson Exp $ */ +/* $Id: parser.c,v 1.71 2001/08/30 05:23:00 marka Exp $ */ #include @@ -949,6 +949,7 @@ zone_only_clauses[] = { { "file", &cfg_type_qstring, 0 }, { "ixfr-base", &cfg_type_qstring, CFG_CLAUSEFLAG_OBSOLETE }, { "ixfr-tmp-file", &cfg_type_qstring, CFG_CLAUSEFLAG_OBSOLETE }, + { "journal-size", &cfg_type_size, 0}, { "masters", &cfg_type_sockaddrkeylist, 0 }, { "pubkey", &cfg_type_pubkey, CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_OBSOLETE },