From 2c70d169bff6e39e6cdf6e2a8c5d1c704c8f49f9 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Wed, 4 Nov 2020 14:43:55 +0100 Subject: [PATCH] simplify, also improve --config output, thanks @mind04 --- pdns/common_startup.cc | 4 ++-- pdns/dynhandler.cc | 4 ++-- pdns/mastercommunicator.cc | 2 +- pdns/packethandler.cc | 8 ++++---- pdns/receiver.cc | 11 +++++++++++ pdns/slavecommunicator.cc | 2 +- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/pdns/common_startup.cc b/pdns/common_startup.cc index 7d646f5bfa..3635a66615 100644 --- a/pdns/common_startup.cc +++ b/pdns/common_startup.cc @@ -578,7 +578,7 @@ void mainthread() } #endif triggerLoadOfLibraries(); - if(::arg().mustDo("master") || ::arg().mustDo("slave") || ::arg().mustDo("primary") || ::arg().mustDo("secondary")) + if(::arg().mustDo("primary") || ::arg().mustDo("secondary")) gethostbyname("a.root-servers.net"); // this forces all lookup libraries to be loaded Utility::dropGroupPrivs(newuid, newgid); if(chroot(::arg()["chroot"].c_str())<0 || chdir("/")<0) { @@ -655,7 +655,7 @@ void mainthread() if(::arg().mustDo("webserver") || ::arg().mustDo("api")) webserver.go(); - if(::arg().mustDo("slave") || ::arg().mustDo("master") || ::arg().mustDo("primary") || ::arg().mustDo("secondary")|| !::arg()["forward-notify"].empty()) + if(::arg().mustDo("primary") || ::arg().mustDo("secondary")|| !::arg()["forward-notify"].empty()) Communicator.go(); TN->go(); // tcp nameserver launch diff --git a/pdns/dynhandler.cc b/pdns/dynhandler.cc index 96ab1ce4e8..d78f38ccc1 100644 --- a/pdns/dynhandler.cc +++ b/pdns/dynhandler.cc @@ -289,7 +289,7 @@ string DLNotifyHostHandler(const vector&parts, Utility::pid_t ppid) ostringstream os; if(parts.size()!=3) return "syntax: notify-host domain ip"; - if(!(::arg().mustDo("master") || ::arg().mustDo("primary")) && !((::arg().mustDo("slave") || ::arg().mustDo("secondary")) && ::arg().mustDo("slave-renotify"))) + if(!::arg().mustDo("primary") && !(::arg().mustDo("secondary") && ::arg().mustDo("secondary-renotify"))) return "PowerDNS not configured as primary (master), or secondary (slave) with re-notifications"; DNSName domain; @@ -317,7 +317,7 @@ string DLNotifyHandler(const vector&parts, Utility::pid_t ppid) UeberBackend B; if(parts.size()!=2) return "syntax: notify domain"; - if(!(::arg().mustDo("master") || ::arg().mustDo("primary")) && !((::arg().mustDo("slave") || ::arg().mustDo("secondary")) && ::arg().mustDo("slave-renotify"))) + if(!::arg().mustDo("primary") && !(::arg().mustDo("secondary") && ::arg().mustDo("secondary-renotify"))) return "PowerDNS not configured as primary (master), or secondary (slave) with re-notifications"; g_log<getBackend(); diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index 5e77a80d76..f7fa4eb030 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -961,7 +961,7 @@ int PacketHandler::processNotify(const DNSPacket& p) g_log<getBackend(); vector rdomains; -- 2.47.2