From e087a327fb50b904a33200f823d533f70a4e2d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 18 Nov 2021 11:29:54 +0200 Subject: [PATCH] MXS-3879: Fix loading of persisted global options The code is now identical to the one in 2.5 and it still suffers from the problem described in MXS-3885. This will be fixed in a separate commit. This commit changes the persisted filename but since it was ignored, it won't affect old installations. --- server/core/config.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/core/config.cc b/server/core/config.cc index 53192d7c8..07ca153c5 100644 --- a/server/core/config.cc +++ b/server/core/config.cc @@ -1232,7 +1232,11 @@ int config_cb(const char* fpath, const struct stat* sb, int typeflag, struct FTW mxb_assert(current_dcontext); mxb_assert(current_ccontext); - if (!config_load_single_file(fpath, current_dcontext, current_ccontext)) + if (strcmp(filename, "maxscale.cnf") == 0 && !config_load_global(fpath)) + { + rval = -1; + } + else if (!config_load_single_file(fpath, current_dcontext, current_ccontext)) { rval = -1; } @@ -4749,7 +4753,7 @@ static bool create_global_config(const char* filename) bool config_global_serialize() { - static const char* GLOBAL_CONFIG_NAME = "global-options"; + static const char* GLOBAL_CONFIG_NAME = "maxscale"; bool rval = false; char filename[PATH_MAX];