]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Fail with error if trying to use settings inside groups which don't work
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 7 Nov 2024 11:55:30 +0000 (13:55 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:40:00 +0000 (10:40 +0200)
src/config/config-parser.c

index 23e0dc5cde62dc2d6ac08bce1cae746ad795f3ca..bfef97ceacfed31b2c9af65fcf7e999c0d833d32 100644 (file)
@@ -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];