Package: release.debian.org
Severity: normal
Tags: bookworm
X-Debbugs-Cc: policyd-rate-li...@packages.debian.org
Control: affects -1 + src:policyd-rate-limit
User: release.debian....@packages.debian.org
Usertags: pu

Hello,

I have uploaded a proposed policyd-rate-limit/1.0.1.1-2.1+deb12u1 change
for bookworm.

With regards,
Samuel

[ Reason ]
As reported on 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1022034
it currently doesn't start at all (because of a yaml change)

[ Impact ]
The package does not work at all.

[ Tests ]
I have tested by hand.

[ Risks ]
The code is quite trivial, coming from upstream.

[ Checklist ]
  [X] *all* changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach debdiff against the package in (old)stable
  [X] the issue is verified as fixed in unstable

[ Changes ]
This comes from upstream and migrates to the new yaml.load() API
diff -Nru policyd-rate-limit-1.0.1.1/debian/changelog 
policyd-rate-limit-1.0.1.1/debian/changelog
--- policyd-rate-limit-1.0.1.1/debian/changelog 2022-10-15 12:37:22.000000000 
+0200
+++ policyd-rate-limit-1.0.1.1/debian/changelog 2025-04-03 18:51:13.000000000 
+0200
@@ -1,3 +1,9 @@
+policyd-rate-limit (1.0.1.1-2.1+deb12u1) bookworm; urgency=medium
+
+  * patches/yaml-load: Fix startup with newer python3-yaml (Closes: #1022034)
+
+ -- Samuel Thibault <sthiba...@debian.org>  Thu, 03 Apr 2025 18:51:13 +0200
+
 policyd-rate-limit (1.0.1.1-2.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru policyd-rate-limit-1.0.1.1/debian/patches/series 
policyd-rate-limit-1.0.1.1/debian/patches/series
--- policyd-rate-limit-1.0.1.1/debian/patches/series    2021-09-16 
04:59:51.000000000 +0200
+++ policyd-rate-limit-1.0.1.1/debian/patches/series    2025-04-03 
18:51:07.000000000 +0200
@@ -1 +1,2 @@
 ignore-init-service.patch
+yaml-load
diff -Nru policyd-rate-limit-1.0.1.1/debian/patches/yaml-load 
policyd-rate-limit-1.0.1.1/debian/patches/yaml-load
--- policyd-rate-limit-1.0.1.1/debian/patches/yaml-load 1970-01-01 
01:00:00.000000000 +0100
+++ policyd-rate-limit-1.0.1.1/debian/patches/yaml-load 2025-04-03 
18:51:07.000000000 +0200
@@ -0,0 +1,84 @@
+commit 6c155a633bf5e9986304b1ca009a4716846e66f9
+Author: Pierre-Elliott Bécue <be...@crans.org>
+Date:   Sat Jan 8 16:48:47 2022 +0100
+
+    Use Loader=SafeLoader for each yaml.load() call
+    
+    Closes issue #15
+
+diff --git a/policyd_rate_limit/tests/test_daemon.py 
b/policyd_rate_limit/tests/test_daemon.py
+index 095c2da..f13b445 100644
+--- a/policyd_rate_limit/tests/test_daemon.py
++++ b/policyd_rate_limit/tests/test_daemon.py
+@@ -41,12 +41,12 @@ class DaemonTestCase(TestCase):
+             self.base_test(cfg)
+ 
+     def test_main_afinet_socket(self):
+-        self.base_config["SOCKET"] = ("127.0.0.1", 27184)
++        self.base_config["SOCKET"] = ["127.0.0.1", 27184]
+         with test_utils.lauch(self.base_config) as cfg:
+             self.base_test(cfg)
+ 
+     def test_main_afinet6_socket(self):
+-        self.base_config["SOCKET"] = ("::1", 27184)
++        self.base_config["SOCKET"] = ["::1", 27184]
+         with test_utils.lauch(self.base_config) as cfg:
+             self.base_test(cfg)
+ 
+@@ -174,10 +174,10 @@ class DaemonTestCase(TestCase):
+                 pass
+ 
+     def test_bad_socket_bind_address(self):
+-        self.base_config["SOCKET"] = ("toto", 1234)
++        self.base_config["SOCKET"] = ["toto", 1234]
+         with test_utils.lauch(self.base_config, get_process=True, 
no_wait=True) as p:
+             self.assertEqual(p.wait(), 4)
+-        self.base_config["SOCKET"] = ("192.168::1", 1234)
++        self.base_config["SOCKET"] = ["192.168::1", 1234]
+         with test_utils.lauch(self.base_config, get_process=True, 
no_wait=True) as p:
+             self.assertEqual(p.wait(), 6)
+ 
+diff --git a/policyd_rate_limit/tests/utils.py 
b/policyd_rate_limit/tests/utils.py
+index d6c1879..0961b11 100644
+--- a/policyd_rate_limit/tests/utils.py
++++ b/policyd_rate_limit/tests/utils.py
+@@ -58,6 +58,8 @@ def postfix_request(sasl_username="", 
client_address="127.0.0.1", protocol_state
+ 
+ @contextmanager
+ def sock(addr):
++    if isinstance(addr, list):
++        addr = tuple(addr)
+     if isinstance(addr, str):
+         s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+     elif '.' in addr[0]:
+@@ -92,7 +94,7 @@ def gen_config(new_config):
+         os.path.join(os.path.dirname(__file__), '..', 
'policyd-rate-limit.yaml')
+     )
+     with open(default_config) as f:
+-        config = yaml.load(f)
++        config = yaml.load(f, Loader=yaml.SafeLoader)
+     config.update(new_config)
+     cfg_path = tempfile.mktemp('.yaml')
+     with open(cfg_path, 'w') as f:
+@@ -156,7 +158,7 @@ def lauch(new_config, get_process=False, options=None, 
no_coverage=False, no_wai
+     try:
+         if cfg_path:
+             with open(cfg_path) as f:
+-                cfg = yaml.load(f)
++                cfg = yaml.load(f, Loader=yaml.SafeLoader)
+             if not no_wait:
+                 time.sleep(0.01)
+                 for i in range(100):
+diff --git a/policyd_rate_limit/utils.py b/policyd_rate_limit/utils.py
+index afb7eb9..91b75a5 100644
+--- a/policyd_rate_limit/utils.py
++++ b/policyd_rate_limit/utils.py
+@@ -85,7 +85,7 @@ class Config(object):
+                     # new config file use yaml
+                     else:
+                         with open(config_file) as f:
+-                            self._config = yaml.load(f)
++                            self._config = yaml.load(f, 
Loader=yaml.SafeLoader)
+                     self.config_file = config_file
+                     break
+                 except PermissionError:

Reply via email to