]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Defer opening files with var-expand templates
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 2 Jan 2025 08:16:17 +0000 (10:16 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 17 Jan 2025 08:40:02 +0000 (10:40 +0200)
src/config/config-parser.c

index b50446777a63a37264e2a7f0709047ceef1cd388..ef16c80295eeb4cf46ef99644ac562ab2cc4a0fa 100644 (file)
@@ -693,7 +693,10 @@ static int config_apply_file(struct config_parser_context *ctx,
                *output_r = "";
                return 0;
        }
-       if (!ctx->expand_values) {
+
+       /* Do not attempt to expand paths that contain variable expansions.
+          These will be expanded later. */
+       if (!ctx->expand_values || strstr(path, "%{") != NULL) {
                *output_r = p_strdup(ctx->pool, path);
                return 0;
        }