From 198d52da3a10769b74fcec718ed9855e979f2786 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Mon, 20 Jan 2020 14:01:36 +0000 Subject: [PATCH 1/3] Fix empty account_validity config block --- synapse/config/registration.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/synapse/config/registration.py b/synapse/config/registration.py index b873995a4..9bb3beedb 100644 --- a/synapse/config/registration.py +++ b/synapse/config/registration.py @@ -29,6 +29,7 @@ class AccountValidityConfig(Config): def __init__(self, config, synapse_config): if config is None: return + super(AccountValidityConfig, self).__init__() self.enabled = config.get("enabled", False) self.renew_by_email_enabled = "renew_at" in config @@ -93,7 +94,7 @@ class RegistrationConfig(Config): ) self.account_validity = AccountValidityConfig( - config.get("account_validity", {}), config + config.get("account_validity") or {}, config ) self.registrations_require_3pid = config.get("registrations_require_3pid", []) From 026f4bdf3c97513b6b48e1f3857198cdb22a3334 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Mon, 20 Jan 2020 14:11:42 +0000 Subject: [PATCH 2/3] Add changelog --- changelog.d/6747.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/6747.bugfix diff --git a/changelog.d/6747.bugfix b/changelog.d/6747.bugfix new file mode 100644 index 000000000..cb088873e --- /dev/null +++ b/changelog.d/6747.bugfix @@ -0,0 +1 @@ +Fix infinite recursion and dictionary access bug when setting `account_validity` to an empty block in the homeserver config. Thanks to @Sorunome for reporting. \ No newline at end of file From 351fdfede6e9582f7c365d41c684b9d60b6c98c2 Mon Sep 17 00:00:00 2001 From: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Date: Mon, 20 Jan 2020 15:58:44 +0000 Subject: [PATCH 3/3] Update changelog.d/6747.bugfix Co-Authored-By: Erik Johnston --- changelog.d/6747.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/6747.bugfix b/changelog.d/6747.bugfix index cb088873e..c98107e74 100644 --- a/changelog.d/6747.bugfix +++ b/changelog.d/6747.bugfix @@ -1 +1 @@ -Fix infinite recursion and dictionary access bug when setting `account_validity` to an empty block in the homeserver config. Thanks to @Sorunome for reporting. \ No newline at end of file +Fix bug when setting `account_validity` to an empty block in the config. Thanks to @Sorunome for reporting.