From b1e4542c3d62d94806d812edca3c8f684ddab71a Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 7 Nov 2024 13:55:30 +0200 Subject: [PATCH] config: Fail with error if trying to use settings inside groups which don't work --- src/config/config-parser.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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]; -- 2.47.3