From: Aki Tuomi Date: Thu, 2 Jan 2025 08:16:17 +0000 (+0200) Subject: config: Defer opening files with var-expand templates X-Git-Tag: 2.4.1~327 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5c1f18b75c8d31d560d0cf5a6b7e1fb23467a5e3;p=thirdparty%2Fdovecot%2Fcore.git config: Defer opening files with var-expand templates --- diff --git a/src/config/config-parser.c b/src/config/config-parser.c index b50446777a..ef16c80295 100644 --- a/src/config/config-parser.c +++ b/src/config/config-parser.c @@ -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; }