From: Chris Hofstaedtler Date: Sat, 25 Jan 2020 22:34:14 +0000 (+0100) Subject: Make Lua mandatory for Auth X-Git-Tag: auth-4.3.0-beta1~11^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0c606b24d54064e81a19c21c00828f1b4d7452c1;p=thirdparty%2Fpdns.git Make Lua mandatory for Auth --- diff --git a/configure.ac b/configure.ac index 6020a85cfe..91daeeab07 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/pdns/lua-auth4.cc b/pdns/lua-auth4.cc index e075b6eb2a..f990f18b48 100644 --- a/pdns/lua-auth4.cc +++ b/pdns/lua-auth4.cc @@ -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 @@ -18,25 +16,6 @@ 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& out) { return false; } -LuaContext* AuthLua4::getLua() { return nullptr; } -std::unique_ptr 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 AuthLua4::prequery(const DNSPacket& q) { } AuthLua4::~AuthLua4() { } - - -#endif diff --git a/pdns/lua-base4.cc b/pdns/lua-base4.cc index 793e0de40c..163f4687a0 100644 --- a/pdns/lua-base4.cc +++ b/pdns/lua-base4.cc @@ -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(new LuaContext); @@ -260,5 +251,3 @@ void BaseLua4::loadStream(std::istream &is) { } BaseLua4::~BaseLua4() { } - -#endif diff --git a/pdns/lua-base4.hh b/pdns/lua-base4.hh index 79300f778c..1dbf62eecb 100644 --- a/pdns/lua-base4.hh +++ b/pdns/lua-base4.hh @@ -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 d_lw; // this is way on top because it must get destroyed _last_ -#endif public: BaseLua4();