]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Make Lua mandatory for Auth
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Sat, 25 Jan 2020 22:34:14 +0000 (23:34 +0100)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Sat, 25 Jan 2020 22:34:14 +0000 (23:34 +0100)
configure.ac
pdns/lua-auth4.cc
pdns/lua-base4.cc
pdns/lua-base4.hh

index 6020a85cfe5cae65f06effb15acc9c04758ba300..91daeeab07791966784ff4bd6036ee011b11ecdf 100644 (file)
@@ -45,7 +45,7 @@ m4_pattern_forbid([^_?PKG_[A-Z_]+$], [*** pkg.m4 missing, please install pkg-con
 PDNS_CHECK_OS
 PTHREAD_SET_NAME
 
-PDNS_WITH_LUA
+PDNS_WITH_LUA([mandatory])
 PDNS_CHECK_LUA_HPP
 
 AX_CXX_COMPILE_STDCXX_11
@@ -205,12 +205,7 @@ for a in $modules $dynmodules; do
       PDNS_CHECK_GEOIP
       ;;
     lua*)
-      AS_IF([test "x$with_lua" = "xno"],
-        [AC_MSG_ERROR([${a} backend needs lua, run ./configure --with-lua])]
-      )
-      AS_IF([test "x$LUAPC" = "x"],
-        [AC_MSG_ERROR([${a} backend needs lua but we cannot find it])]
-      )
+      dnl Lua has been checked above
       ;;
     lmdb)
       needlmdb=yes
index e075b6eb2a4f9ec5f2a3aa7495506098cf8cd339..f990f18b488177c54eee06bd75a133662739ea13 100644 (file)
@@ -1,7 +1,5 @@
 #include "config.h"
-#if defined(HAVE_LUA)
 #include "ext/luawrapper/include/LuaContext.hpp"
-#endif
 #include "lua-auth4.hh"
 #include "stubresolver.hh"
 #include <fstream>
 
 AuthLua4::AuthLua4() { prepareContext(); }
 
-#if !defined(HAVE_LUA)
-
-bool AuthLua4::updatePolicy(const DNSName &qname, QType qtype, const DNSName &zonename, const DNSPacket& packet) { return false; }
-bool AuthLua4::axfrfilter(const ComboAddress& remote, const DNSName& zone, const DNSResourceRecord& in, vector<DNSResourceRecord>& out) { return false; }
-LuaContext* AuthLua4::getLua() { return nullptr; }
-std::unique_ptr<DNSPacket> AuthLua4::prequery(const DNSPacket& q) { return nullptr; }
-
-AuthLua4::~AuthLua4() { }
-
-void AuthLua4::postPrepareContext()
-{
-}
-
-void AuthLua4::postLoad()
-{
-}
-
-#else
-
 LuaContext* AuthLua4::getLua()
 {
   return d_lw.get();
@@ -187,6 +166,3 @@ std::unique_ptr<DNSPacket> AuthLua4::prequery(const DNSPacket& q) {
 }
 
 AuthLua4::~AuthLua4() { }
-
-
-#endif
index 793e0de40ce3d9523e4e3e9ab2fb273a3709a028..163f4687a0504aed2270e106a1d0cc3c2b7afc5f 100644 (file)
@@ -10,6 +10,7 @@
 #include "namespaces.hh"
 #include "ednssubnet.hh"
 #include "lua-base4.hh"
+#include "ext/luawrapper/include/LuaContext.hpp"
 #include "dns_random.hh"
 
 BaseLua4::BaseLua4() {
@@ -32,16 +33,6 @@ void BaseLua4::loadString(const std::string &script) {
 //  By default no features
 void BaseLua4::getFeatures(Features &) { }
 
-#if !defined(HAVE_LUA)
-
-void BaseLua4::prepareContext() { return; }
-void BaseLua4::loadStream(std::istream &is) { return; }
-BaseLua4::~BaseLua4() { }
-
-#else
-
-#include "ext/luawrapper/include/LuaContext.hpp"
-
 void BaseLua4::prepareContext() {
   d_lw = std::unique_ptr<LuaContext>(new LuaContext);
 
@@ -260,5 +251,3 @@ void BaseLua4::loadStream(std::istream &is) {
 }
 
 BaseLua4::~BaseLua4() { }
-
-#endif
index 79300f778c270b9d64fa2debaef2c6b1dda20c86..1dbf62eecb39cca01a38d827ca7f5e5f3903c8b6 100644 (file)
@@ -4,19 +4,12 @@
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
-
-class LuaContext;
-
-#if defined(HAVE_LUA)
 #include "ext/luawrapper/include/LuaContext.hpp"
-#endif
 
 class BaseLua4 : public boost::noncopyable
 {
 protected:
-#ifdef HAVE_LUA
   std::unique_ptr<LuaContext> d_lw; // this is way on top because it must get destroyed _last_
-#endif
 
 public:
   BaseLua4();