From 93946375ca57a52a0513031fc3c45c8ffab79e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Tue, 7 Aug 2018 00:09:22 +0300 Subject: [PATCH] Ignore passwd in persisted configurations If a passwd parameter is defined in a persisted configuration, it will be ignored. This will make upgrades from 2.2 to 2.3 possible with persisted configurations. --- server/core/config.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/core/config.cc b/server/core/config.cc index e23f24c70..ca51c4028 100644 --- a/server/core/config.cc +++ b/server/core/config.cc @@ -601,6 +601,17 @@ static int ini_handler(void *userdata, const char *section, const char *name, co CONFIG_CONTEXT *cntxt = (CONFIG_CONTEXT *)userdata; CONFIG_CONTEXT *ptr = cntxt; + const std::set legacy_parameters{"passwd"}; + + if (is_persisted_config && legacy_parameters.count(name)) + { + /** + * Ignore legacy parameters in persisted configurations. Needs to be + * done to make upgrades from pre-2.3 versions work. + */ + return 1; + } + if (is_empty_string(value)) { if (is_persisted_config)