From: Olivier Houchard Date: Fri, 28 Aug 2026 15:04:51 +0000 (+0200) Subject: BUG/MEDIUM: server: Fix server-template with default-server X-Git-Tag: v3.5-dev6~55 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=5ce3647dbcfeb9fd552265fbf2499086354578e8;p=haproxy.git BUG/MEDIUM: server: Fix server-template with default-server Commit c81044a8b moved the call for srv_settings_cpy() from _srv_parse_init() to parse_server(), but in doing so, it will use 1 as the last argument if the new server is a server template. This is, however, wrong, srv_settings_cpy() expect 1 if the source is a server template, not the destination. Doing that will lead to an uninitialized server, if there were settings to copy from another server. This fixes using server templates with default-server. --- diff --git a/src/server.c b/src/server.c index c7ed32d77..f8fa20cb8 100644 --- a/src/server.c +++ b/src/server.c @@ -4317,7 +4317,7 @@ int parse_server(const char *file, int linenum, char **args, if (newsrv != from) { /* This will copy settings or init them if NULL. */ - srv_settings_cpy(newsrv, from, !!(parse_flags & SRV_PARSE_TEMPLATE)); + srv_settings_cpy(newsrv, from, 0); } if (!newsrv->conf.file) // note: do it only once for default-server