From: Otto Moerbeek Date: Tue, 29 Oct 2024 09:52:37 +0000 (+0100) Subject: Give a more sensible message for rec_control show-yaml if recursor.conf already conta... X-Git-Tag: rec-5.2.0-alpha1~13^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d504d56fd8ae7fc9bd199f14ff7bf149964786be;p=thirdparty%2Fpdns.git Give a more sensible message for rec_control show-yaml if recursor.conf already contains YAML --- diff --git a/pdns/recursordist/rec_control.cc b/pdns/recursordist/rec_control.cc index 30187a11fe..2197ca0ba0 100644 --- a/pdns/recursordist/rec_control.cc +++ b/pdns/recursordist/rec_control.cc @@ -247,6 +247,10 @@ static RecursorControlChannel::Answer showYAML(const std::string& path) try { std::string msg; auto converted = pdns::settings::rec::oldStyleSettingsFileToYaml(configName, true); + if (converted == "{}\n") { + msg += "There seems to be no YAML config in " + configName; + return {1, std::move(msg)}; + } msg += "# Start of converted recursor.yml based on " + configName + "\n"; msg += converted; msg += "# Validation result: ";