]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Do not build secpoll support when DISABLE_SECPOLL is defined
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 9 Nov 2021 14:12:09 +0000 (15:12 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 22 Dec 2021 08:30:43 +0000 (09:30 +0100)
pdns/dnsdist-lua.cc
pdns/dnsdist.cc
pdns/dnsdistdist/dnsdist-secpoll.cc
pdns/dnsdistdist/dnsdist-secpoll.hh

index 13bdb4de2207ff28d71c353c7b5c542ccf71e6d1..768a8983b29483284172f20359f58aed4fcd3db7 100644 (file)
@@ -2254,6 +2254,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
     g_PayloadSizeSelfGenAnswers = payloadSize;
   });
 
+#ifndef DISABLE_SECPOLL
   luaCtx.writeFunction("setSecurityPollSuffix", [](const std::string& suffix) {
     if (g_configurationDone) {
       g_outputBuffer = "setSecurityPollSuffix() cannot be used at runtime!\n";
@@ -2271,6 +2272,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
 
     g_secPollInterval = newInterval;
   });
+#endif /* DISABLE_SECPOLL */
 
   luaCtx.writeFunction("setSyslogFacility", [](boost::variant<int, std::string> facility) {
     setLuaSideEffect();
index 3aee155b710f1f90925f49fc1fd1b9fa7e9de930..d5eecce2d75c70843bc43d9a1ff794d0092a95d2 100644 (file)
@@ -1840,6 +1840,7 @@ static void dynBlockMaintenanceThread()
   DynBlockMaintenance::run();
 }
 
+#ifndef DISABLE_SECPOLL
 static void secPollThread()
 {
   setThreadName("dnsdist/secpoll");
@@ -1853,6 +1854,7 @@ static void secPollThread()
     sleep(g_secPollInterval);
   }
 }
+#endif /* DISABLE_SECPOLL */
 
 static void healthChecksThread()
 {
@@ -2704,10 +2706,12 @@ int main(int argc, char** argv)
     thread dynBlockMaintThread(dynBlockMaintenanceThread);
     dynBlockMaintThread.detach();
 
+#ifndef DISABLE_SECPOLL
     if (!g_secPollSuffix.empty()) {
       thread secpollthread(secPollThread);
       secpollthread.detach();
     }
+#endif /* DISABLE_SECPOLL */
 
     if(g_cmdLine.beSupervised) {
 #ifdef HAVE_SYSTEMD
index 79e3f69f494f68899a318e51bc8c906a83b2c5d7..008302d111283199571ea2fbf569ec4246ca6d22 100644 (file)
@@ -20,9 +20,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "config.h"
+#include "dnsdist-secpoll.hh"
+#ifndef DISABLE_SECPOLL
 
-#include <string>
 #include <vector>
 
 #ifdef HAVE_LIBSODIUM
@@ -36,7 +36,6 @@
 #include "sstuff.hh"
 
 #include "dnsdist.hh"
-#include "dnsdist-secpoll.hh"
 
 #ifndef PACKAGEVERSION
 #define PACKAGEVERSION PACKAGE_VERSION
@@ -244,3 +243,5 @@ void doSecPoll(const std::string& suffix)
     g_secPollDone = true;
   }
 }
+
+#endif /* DISABLE_SECPOLL */
index c7d886917ef85e89438a950abef00fea34449aa2..536fb39cce9e58e0ad56950a4d12d7bc09d68b45 100644 (file)
  */
 #pragma once
 
+#include "config.h"
+
+#ifndef DISABLE_SECPOLL
+#include <string>
+
 extern std::string g_secPollSuffix;
 extern time_t g_secPollInterval;
 
 void doSecPoll(const std::string& suffix);
+#endif /* DISABLE_SECPOLL */