]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
fIx API old-style to YAML conversion for ACLS using += and multiple entries 14653/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 11 Sep 2024 08:18:38 +0000 (10:18 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 11 Sep 2024 09:40:14 +0000 (11:40 +0200)
Candidate for backporting

pdns/recursordist/settings/cxxsupport.cc
regression-tests.recursor/YAMLConversion/allow-from.yml.expected
regression-tests.recursor/YAMLConversion/allow-notify-from.yml.expected

index db1053f110cfc02d7631c92c60c0bc32e58d7b3f..1a4d59d9f5388ad2fe57a3f693c0abfcebddf658 100644 (file)
@@ -166,7 +166,11 @@ static void possiblyConvertACLFile(const string& includeDir, const string& apiDi
     if (plusis != string::npos) {
       auto val = line.substr(plusis + 2);
       boost::trim(val);
-      result.emplace_back(val);
+      vector<string> acls;
+      stringtok(acls, val, " ,\t");
+      for (const auto& acl : acls) {
+        result.emplace_back(acl);
+      }
     }
   }
 
index 7dbc41463256aa1fa3e3d365429004b67cf28ed5..b49ae032d6bf131521e1c090bb5a20647954e1d1 100644 (file)
@@ -2,5 +2,6 @@
 incoming:
   allow_from_file: ''
   allow_from: !override
-  - 1.2.3.4/32, 127.0.0.0/24
+  - '1.2.3.4/32'
+  - '127.0.0.0/24'
 
index 0e17dcd0303eaa8e765866e4aaffb4e08580ffe7..7bf51d01b52670faef21f45368f41e0e180fd8d3 100644 (file)
@@ -2,5 +2,5 @@
 incoming:
   allow_notify_from_file: ''
   allow_notify_from: !override
-  - 127.0.0.0/24
+  - '127.0.0.0/24'