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.
This commit is contained in:
Markus Mäkelä 2021-11-18 11:29:54 +02:00
parent 39abee7b9a
commit e087a327fb
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499

View File

@ -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];