]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
recursor: Don't parse any config with `--version` 9577/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Thu, 1 Oct 2020 11:47:27 +0000 (13:47 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 2 Oct 2020 08:48:20 +0000 (10:48 +0200)
This ensures we don't log anything _apart_ from the version info.
Spotted in https://github.com/PowerDNS/pdns_recursor-ansible/issues/66

(cherry picked from commit 2733183fc0b35ed2b59c87aab5aaaa86688db778)

pdns/pdns_recursor.cc

index 9a0475002976b09ae6f972e90e86b9e4ff39ca85..55fa8c66f768425fc50437fd51c1e54244f23fc5 100644 (file)
@@ -5212,6 +5212,12 @@ int main(int argc, char **argv)
     g_log.toConsole(Logger::Info);
     ::arg().laxParse(argc,argv); // do a lax parse
 
+    if(::arg().mustDo("version")) {
+      showProductVersion();
+      showBuildConfiguration();
+      exit(0);
+    }
+
     string configname=::arg()["config-dir"]+"/recursor.conf";
     if(::arg()["config-name"]!="") {
       configname=::arg()["config-dir"]+"/recursor-"+::arg()["config-name"]+".conf";
@@ -5282,11 +5288,6 @@ int main(int argc, char **argv)
       cout<<::arg().helpstring(::arg()["help"])<<endl;
       exit(0);
     }
-    if(::arg().mustDo("version")) {
-      showProductVersion();
-      showBuildConfiguration();
-      exit(0);
-    }
 
     s_RC = std::unique_ptr<MemRecursorCache>(new MemRecursorCache(::arg().asNum("record-cache-shards")));