]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - pdns/lua-auth4.cc
auth: switch circleci mssql image
[thirdparty/pdns.git] / pdns / lua-auth4.cc
index b89e50e6d33ea4b5c87fe41cc9e8e0ce8e9195ae..dae104b14032b784aa4c6f6782cf235bccbf7312 100644 (file)
@@ -1,3 +1,7 @@
+#include "config.h"
+#if defined(HAVE_LUA)
+#include "ext/luawrapper/include/LuaContext.hpp"
+#endif
 #include "lua-auth4.hh"
 #include "stubresolver.hh"
 #include <fstream>
@@ -6,6 +10,11 @@
 #include "namespaces.hh"
 #include "ednssubnet.hh"
 #include <unordered_set>
+#include "sstuff.hh"
+#include <thread>
+#include <mutex>
+
+#include "ueberbackend.hh"
 
 AuthLua4::AuthLua4() { prepareContext(); }
 
@@ -13,6 +22,7 @@ AuthLua4::AuthLua4() { prepareContext(); }
 
 bool AuthLua4::updatePolicy(const DNSName &qname, QType qtype, const DNSName &zonename, 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 0; }
 DNSPacket *AuthLua4::prequery(DNSPacket *q) { return NULL; }
 
 AuthLua4::~AuthLua4() { }
@@ -27,11 +37,12 @@ void AuthLua4::postLoad()
 
 #else
 
-#include "ext/luawrapper/include/LuaContext.hpp"
+LuaContext* AuthLua4::getLua()
+{
+  return d_lw.get();
+}
 
 void AuthLua4::postPrepareContext() {
-  stubParseResolveConf();
-
   d_lw->writeFunction("resolve", [](const std::string& qname, uint16_t qtype) {
       std::vector<DNSZoneRecord> ret;
       std::unordered_map<int, DNSResourceRecord> luaResult;
@@ -101,7 +112,6 @@ void AuthLua4::postLoad() {
   d_update_policy = d_lw->readVariable<boost::optional<luacall_update_policy_t>>("updatepolicy").get_value_or(0);
   d_axfr_filter = d_lw->readVariable<boost::optional<luacall_axfr_filter_t>>("axfrfilter").get_value_or(0);
   d_prequery = d_lw->readVariable<boost::optional<luacall_prequery_t>>("prequery").get_value_or(0);
-
 }
 
 bool AuthLua4::axfrfilter(const ComboAddress& remote, const DNSName& zone, const DNSResourceRecord& in, vector<DNSResourceRecord>& out) {
@@ -178,4 +188,5 @@ DNSPacket *AuthLua4::prequery(DNSPacket *q) {
 
 AuthLua4::~AuthLua4() { }
 
+
 #endif