]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Give a more sensible message for rec_control show-yaml if recursor.conf already conta...
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 29 Oct 2024 09:52:37 +0000 (10:52 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 4 Nov 2024 11:44:36 +0000 (12:44 +0100)
pdns/recursordist/rec_control.cc

index 30187a11fe422b7d9105219c4cc9174c0c49c4fd..2197ca0ba0eed7b1807f330a4849bfe26d777f9d 100644 (file)
@@ -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: ";