a99c7c
From 419d7fd6e5a9ed2d356ad05eef1043309f5646ef Mon Sep 17 00:00:00 2001
a99c7c
From: Michal Polovka <mpolovka@redhat.com>
a99c7c
Date: Fri, 7 Jan 2022 12:12:26 +0100
a99c7c
Subject: [PATCH] ipatests: webui: Use safe-loader for loading YAML
a99c7c
 configuration file
a99c7c
a99c7c
FullLoader class for YAML loader was introduced in version 5.1 which
a99c7c
also deprecated default loader. SafeLoader, however, stays consistent
a99c7c
across the versions and brings added security.
a99c7c
a99c7c
This fix is necessary as PyYAML > 5.1 is not available in downstream.
a99c7c
a99c7c
Related: https://pagure.io/freeipa/issue/9009
a99c7c
a99c7c
Signed-off-by: Michal Polovka <mpolovka@redhat.com>
a99c7c
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
a99c7c
---
a99c7c
 ipatests/test_webui/ui_driver.py | 2 +-
a99c7c
 1 file changed, 1 insertion(+), 1 deletion(-)
a99c7c
a99c7c
diff --git a/ipatests/test_webui/ui_driver.py b/ipatests/test_webui/ui_driver.py
a99c7c
index 77fd74e49593183a37fe735bedf2e0d6b9257ac7..519efee9bba3de2114d22865a08df87f9b5f348a 100644
a99c7c
--- a/ipatests/test_webui/ui_driver.py
a99c7c
+++ b/ipatests/test_webui/ui_driver.py
a99c7c
@@ -192,7 +192,7 @@ class UI_driver:
a99c7c
         if not NO_YAML and os.path.isfile(path):
a99c7c
             try:
a99c7c
                 with open(path, 'r') as conf:
a99c7c
-                    cls.config = yaml.load(stream=conf, Loader=yaml.FullLoader)
a99c7c
+                    cls.config = yaml.safe_load(stream=conf)
a99c7c
             except yaml.YAMLError as e:
a99c7c
                 pytest.skip("Invalid Web UI config.\n%s" % e)
a99c7c
             except IOError as e:
a99c7c
-- 
a99c7c
2.34.1
a99c7c