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

View File

@ -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))
{