]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add test for previous fix.
authorMiod Vallat <miod.vallat@powerdns.com>
Mon, 9 Feb 2026 09:00:09 +0000 (10:00 +0100)
committerMiod Vallat <miod.vallat@powerdns.com>
Mon, 9 Feb 2026 10:30:16 +0000 (11:30 +0100)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
regression-tests.api/test_Zones.py

index 372b1cc6710777df1ce4f04bad9b5c7533fffe0e..114a826891f0fe3dafa8c9e6cb6a0c13de26013f 100644 (file)
@@ -1377,6 +1377,29 @@ $NAME$  1D  IN  SOA ns1.example.org. hostmaster.example.org. (
         self.assertEqual(r.status_code, 422)
         self.assert_in_json_error("Exactly one record should be provided", r.json())
 
+    def test_zone_rr_bogus_update_4(self):
+        name, payload, zone = self.create_zone()
+        # rrset with invalid characters which are not processed by parseRFC1035CharString
+        rrset = {
+            'changetype': 'replace',
+            'name': 'a.'+name,
+            'type': 'A',
+            'ttl': 3600,
+            'records': [
+                {
+                    "content": "(127.0.0.1)",
+                    "disabled": False
+                }
+            ]
+        }
+        payload = {'rrsets': [rrset]}
+        r = self.session.patch(
+            self.url("/api/v1/servers/localhost/zones/" + name),
+            data=json.dumps(payload),
+            headers={'content-type': 'application/json'})
+        self.assertEqual(r.status_code, 422)
+        self.assert_in_json_error("Invalid character '(' in record content", r.json())
+
     def test_zone_rr_update(self):
         name, payload, zone = self.create_zone()
         # do a replace (= update)