From: Marco Bettini Date: Mon, 27 Jun 2022 12:40:47 +0000 (+0200) Subject: config: old_settings_handle_path() - Handle case where path// has x other than 0 X-Git-Tag: 2.4.0~3941 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=227a771b81f54ba671febce3e7530aaaa74e71fb;p=thirdparty%2Fdovecot%2Fcore.git config: old_settings_handle_path() - Handle case where path// has x other than 0 --- diff --git a/src/config/old-set-parser.c b/src/config/old-set-parser.c index 81258f24d2..a24c13b956 100644 --- a/src/config/old-set-parser.c +++ b/src/config/old-set-parser.c @@ -7,6 +7,7 @@ #include "old-set-parser.h" #include "istream.h" #include "base64.h" +#include #define config_apply_line (void)config_apply_line @@ -659,11 +660,14 @@ static bool old_settings_handle_path(struct config_parser_context *ctx, const char *key, const char *value) { - if (strcmp(str_c(ctx->str), "plugin/0/") == 0) { + char end; + int index; + if (sscanf(str_c(ctx->str), "plugin/%d%c]", &index, &end) == 2 && end == '/') { if (strcmp(key, "imap_zlib_compress_level") == 0) { obsolete(ctx, "%s has been replaced by imap_compress_deflate_level", key); - config_apply_line(ctx, key, - t_strdup_printf("plugin/0/imap_compress_deflate_level=%s", value), NULL); + config_apply_line(ctx, key, t_strdup_printf( + "plugin/%d/imap_compress_deflate_level=%s", + index, value), NULL); return TRUE; } }