From 982fec5a60bea8a643202d26a77ebd70cc79a87d Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Sun, 5 Feb 2023 08:54:53 -0500 Subject: [PATCH] matrixsynapse: Use yaml.safe_load yaml.load() now requires a Loader= argument. yaml.safe_load() passes SafeLoader to yaml.load(). Fixes: #2315. Tests: - Matrix functional tests passed in testing container. - Matrix functional tests passed in stable container. Signed-off-by: James Valleroy Reviewed-by: Sunil Mohan Adapa --- plinth/modules/matrixsynapse/privileged.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plinth/modules/matrixsynapse/privileged.py b/plinth/modules/matrixsynapse/privileged.py index d8b98111e..f0620397c 100644 --- a/plinth/modules/matrixsynapse/privileged.py +++ b/plinth/modules/matrixsynapse/privileged.py @@ -49,7 +49,7 @@ def post_install(): # start with listener config from original homeserver.yaml with open(ORIG_CONF_PATH, encoding='utf-8') as orig_conf_file: - orig_config = yaml.load(orig_conf_file) + orig_config = yaml.safe_load(orig_conf_file) listeners = orig_config['listeners'] for listener in listeners: @@ -77,11 +77,11 @@ def public_registration(command: str) -> Optional[bool]: try: with open(REGISTRATION_CONF_PATH, encoding='utf-8') as reg_conf_file: - config = yaml.load(reg_conf_file) + config = yaml.safe_load(reg_conf_file) except FileNotFoundError: # Check if its set in original conffile. with open(ORIG_CONF_PATH, encoding='utf-8') as orig_conf_file: - orig_config = yaml.load(orig_conf_file) + orig_config = yaml.safe_load(orig_conf_file) config = { 'enable_registration': orig_config.get('enable_registration', False)