From: Otto Moerbeek Date: Wed, 11 Sep 2024 08:18:38 +0000 (+0200) Subject: fIx API old-style to YAML conversion for ACLS using += and multiple entries X-Git-Tag: rec-5.2.0-alpha1~46^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ac9bb2261ffea35201827f18e302adcbca67ac6;p=thirdparty%2Fpdns.git fIx API old-style to YAML conversion for ACLS using += and multiple entries Candidate for backporting --- diff --git a/pdns/recursordist/settings/cxxsupport.cc b/pdns/recursordist/settings/cxxsupport.cc index db1053f110..1a4d59d9f5 100644 --- a/pdns/recursordist/settings/cxxsupport.cc +++ b/pdns/recursordist/settings/cxxsupport.cc @@ -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 acls; + stringtok(acls, val, " ,\t"); + for (const auto& acl : acls) { + result.emplace_back(acl); + } } } diff --git a/regression-tests.recursor/YAMLConversion/allow-from.yml.expected b/regression-tests.recursor/YAMLConversion/allow-from.yml.expected index 7dbc414632..b49ae032d6 100644 --- a/regression-tests.recursor/YAMLConversion/allow-from.yml.expected +++ b/regression-tests.recursor/YAMLConversion/allow-from.yml.expected @@ -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' diff --git a/regression-tests.recursor/YAMLConversion/allow-notify-from.yml.expected b/regression-tests.recursor/YAMLConversion/allow-notify-from.yml.expected index 0e17dcd030..7bf51d01b5 100644 --- a/regression-tests.recursor/YAMLConversion/allow-notify-from.yml.expected +++ b/regression-tests.recursor/YAMLConversion/allow-notify-from.yml.expected @@ -2,5 +2,5 @@ incoming: allow_notify_from_file: '' allow_notify_from: !override - - 127.0.0.0/24 + - '127.0.0.0/24'