From: Daniel Salzman Date: Mon, 14 Dec 2020 10:10:21 +0000 (+0100) Subject: conf: add check on ambiguous 'storage' configuration X-Git-Tag: v3.1.0~279 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5172fb00e38ce2e2235faf4e27e70756394cc4df;p=thirdparty%2Fknot-dns.git conf: add check on ambiguous 'storage' configuration closes #706 --- diff --git a/src/knot/conf/tools.c b/src/knot/conf/tools.c index 51573ecc40..ad80625c35 100644 --- a/src/knot/conf/tools.c +++ b/src/knot/conf/tools.c @@ -598,13 +598,21 @@ int check_template( CONF_LOG(LOG_NOTICE, "option 'disable-any' is deprecated and has no effect"); } - // Stop if the default template. if (is_default_id(args->id, args->id_len)) { - return KNOT_EOK; + conf_val_t db_storage = conf_get_txn(args->extra->conf, args->extra->txn, + C_DB, C_STORAGE); + conf_val_t tpl_storage = conf_rawid_get_txn(args->extra->conf, args->extra->txn, + C_TPL, C_STORAGE, args->id, args->id_len); + if (db_storage.code != KNOT_EOK && tpl_storage.code == KNOT_EOK && + strcmp(conf_str(&tpl_storage), STORAGE_DIR) != 0) { + CONF_LOG(LOG_NOTICE, "non-default 'template[default].storage' detected, " + "please configure also 'db.storage' to avoid compatibility " + "issues with future versions"); + } + } else { + CHECK_DFLT(C_GLOBAL_MODULE, "global module"); } - CHECK_DFLT(C_GLOBAL_MODULE, "global module"); - return KNOT_EOK; }