From e9da486c958dcbc28f69c487d3ade091ffcbd0da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 18 Nov 2021 11:41:29 +0200 Subject: [PATCH] MXS-3885: Fix loading of configs from directories The global config handler should only be used for the persisted maxscale.cnf file, not for all files named maxscale.cnf. --- server/core/config.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/core/config.cc b/server/core/config.cc index 07ca153c5..27e194d1d 100644 --- a/server/core/config.cc +++ b/server/core/config.cc @@ -1232,9 +1232,12 @@ int config_cb(const char* fpath, const struct stat* sb, int typeflag, struct FTW mxb_assert(current_dcontext); mxb_assert(current_ccontext); - if (strcmp(filename, "maxscale.cnf") == 0 && !config_load_global(fpath)) + if (is_persisted_config && strcmp(filename, "maxscale.cnf") == 0) { - rval = -1; + if (!config_load_global(fpath)) + { + rval = -1; + } } else if (!config_load_single_file(fpath, current_dcontext, current_ccontext)) {