From 1ac9bb2261ffea35201827f18e302adcbca67ac6 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Wed, 11 Sep 2024 10:18:38 +0200 Subject: [PATCH] fIx API old-style to YAML conversion for ACLS using += and multiple entries Candidate for backporting --- pdns/recursordist/settings/cxxsupport.cc | 6 +++++- .../YAMLConversion/allow-from.yml.expected | 3 ++- .../YAMLConversion/allow-notify-from.yml.expected | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) 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' -- 2.47.2