From dcbd91deeef819b14c4aebd1acc3a37756d26529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 2 May 2017 11:21:32 +0300 Subject: [PATCH] Fix filters parameter processing The filter names for the service parameter `filters` weren't converted into the new format. This caused a configuration error when a filter with significant whitespace in its name was used in a service. --- server/core/maxscale/config.h | 7 +++++++ server/core/service.cc | 2 ++ 2 files changed, 9 insertions(+) diff --git a/server/core/maxscale/config.h b/server/core/maxscale/config.h index 8c86d9a39..eb32e0430 100644 --- a/server/core/maxscale/config.h +++ b/server/core/maxscale/config.h @@ -142,4 +142,11 @@ void config_add_module_params_json(const MXS_MODULE* mod, const char** type_params, json_t* output); +/** + * @brief Convert section names to new format + * + * @param section Section name to fix + */ +void fix_section_name(char *section); + MXS_END_DECLS diff --git a/server/core/service.cc b/server/core/service.cc index de6880f22..130e2a487 100644 --- a/server/core/service.cc +++ b/server/core/service.cc @@ -1222,6 +1222,8 @@ serviceSetFilters(SERVICE *service, char *filters) ptr = strtok_r(filters, "|", &brkt); while (ptr) { + fix_section_name(ptr); + n++; MXS_FILTER_DEF **tmp; if ((tmp = (MXS_FILTER_DEF **) MXS_REALLOC(flist,