From: Peter van Dijk Date: Fri, 13 Apr 2018 22:07:13 +0000 (+0200) Subject: only parse resolv.conf once - this avoids race conditions X-Git-Tag: dnsdist-1.3.1~24^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faf7f65bc23283f5b521ccf456d01ffc01d6c461;p=thirdparty%2Fpdns.git only parse resolv.conf once - this avoids race conditions --- 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() {