]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Fail if trying to give section name for strlist or boollist setting
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 3 Nov 2025 08:22:54 +0000 (10:22 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 7 Nov 2025 12:51:46 +0000 (14:51 +0200)
For example this should fail:

mail_plugins foo {
}

src/config/config-parser.c

index 91e5fdaf85fe8f599c99c1463cacb18d4ade80dd..61a7e0955591a0308a2137a823bb3094434be9ee 100644 (file)
@@ -3254,6 +3254,9 @@ void config_parser_apply_line(struct config_parser_context *ctx,
                if (def->type != SET_STRLIST && def->type != SET_BOOLLIST) {
                        ctx->error = p_strdup_printf(ctx->pool,
                                "Setting %s cannot be used as a section", key);
+               } else if (line->value[0] != '\0') {
+                       ctx->error = p_strdup_printf(ctx->pool,
+                               "Setting %s cannot have a value for the section", key);
                }
                break;
        }