From faf7f65bc23283f5b521ccf456d01ffc01d6c461 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Sat, 14 Apr 2018 00:07:13 +0200 Subject: [PATCH] only parse resolv.conf once - this avoids race conditions --- pdns/lua-auth4.cc | 2 -- pdns/stubresolver.cc | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/lua-auth4.cc b/pdns/lua-auth4.cc index b89e50e6d3..a028d62f7f 100644 --- a/pdns/lua-auth4.cc +++ b/pdns/lua-auth4.cc @@ -30,8 +30,6 @@ void AuthLua4::postLoad() #include "ext/luawrapper/include/LuaContext.hpp" void AuthLua4::postPrepareContext() { - stubParseResolveConf(); - d_lw->writeFunction("resolve", [](const std::string& qname, uint16_t qtype) { std::vector ret; std::unordered_map luaResult; diff --git a/pdns/stubresolver.cc b/pdns/stubresolver.cc index 1006618bad..47901aa075 100644 --- a/pdns/stubresolver.cc +++ b/pdns/stubresolver.cc @@ -94,6 +94,8 @@ static void parseLocalResolvConf() * First, parse the `resolver` configuration option for IP addresses to use. * If that doesn't work, parse /etc/resolv.conf and add those nameservers to * s_resolversForStub. + * + * mainthread() calls this so you don't have to. */ void stubParseResolveConf() { -- 2.47.2