diff --git a/server/modules/filter/cache/cachefilter.cc b/server/modules/filter/cache/cachefilter.cc index d01db8ecb..84990b71d 100644 --- a/server/modules/filter/cache/cachefilter.cc +++ b/server/modules/filter/cache/cachefilter.cc @@ -315,35 +315,11 @@ bool CacheFilter::process_params(char **pzOptions, CONFIG_PARAMETER *ppParams, C error = true; } - const CONFIG_PARAMETER *pParam = config_get_param(ppParams, "rules"); + config.rules = config_copy_string(ppParams, "rules"); + + const CONFIG_PARAMETER *pParam = config_get_param(ppParams, "storage_options"); if (pParam) - { - if (*pParam->value == '/') - { - config.rules = MXS_STRDUP(pParam->value); - } - else - { - const char* datadir = get_datadir(); - size_t len = strlen(datadir) + 1 + strlen(pParam->value) + 1; - - char *rules = (char*)MXS_MALLOC(len); - - if (rules) - { - sprintf(rules, "%s/%s", datadir, pParam->value); - config.rules = rules; - } - } - - if (!config.rules) - { - error = true; - } - } - - if ((pParam = config_get_param(ppParams, "storage_options"))) { config.storage_options = MXS_STRDUP(pParam->value); diff --git a/server/modules/filter/masking/maskingfilter.cc b/server/modules/filter/masking/maskingfilter.cc index 710cc44b6..7895a4c22 100644 --- a/server/modules/filter/masking/maskingfilter.cc +++ b/server/modules/filter/masking/maskingfilter.cc @@ -181,16 +181,6 @@ void MaskingFilter::reload(DCB* pOut) // static void MaskingFilter::process_params(char **pzOptions, CONFIG_PARAMETER *pParams, Config& config) { - const char *value = config_get_string(pParams, "rules_file"); - string rules_file; - - if (*value != '/') - { - // A relative path is interpreted relative to the data directory. - rules_file += get_datadir(); - rules_file += "/"; - } - - rules_file += value; + string rules_file = config_get_string(pParams, "rules_file"); config.set_rules_file(rules_file); }