From: Timo Sirainen Date: Thu, 7 Nov 2024 11:55:30 +0000 (+0200) Subject: config: Fail with error if trying to use settings inside groups which don't work X-Git-Tag: 2.4.0~287 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9f09a749c83342f2a5957c74e144ee6d6e3ef21b;p=thirdparty%2Fdovecot%2Fcore.git config: Fail with error if trying to use settings inside groups which don't work --- diff --git a/src/config/config-parser.c b/src/config/config-parser.c index 23e0dc5cde..bfef97ceac 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -713,6 +713,17 @@ config_apply_exact_line(struct config_parser_context *ctx, if (config_key == NULL) return 0; + /* FIXME: These don't work because config_parsed_get_setting() doesn't + expand groups. Maybe not worth the effort to fix it? */ + if ((strcmp(lookup_key, "import_environment") == 0 || + strcmp(lookup_key, "base_dir") == 0 || + strcmp(lookup_key, "dovecot_storage_version") == 0) && + config_filter_has_include_group(&ctx->cur_section->filter_parser->filter)) { + ctx->error = p_strdup_printf(ctx->pool, + "%s cannot currently be defined inside groups", lookup_key); + return -1; + } + for (; config_key != NULL; config_key = config_key->next) { struct config_module_parser *l = &ctx->cur_section->filter_parser->module_parsers[config_key->info_idx];