]> granicus.if.org Git - pdns/commitdiff
only parse resolv.conf once - this avoids race conditions
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 13 Apr 2018 22:07:13 +0000 (00:07 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 13 Apr 2018 22:07:13 +0000 (00:07 +0200)
pdns/lua-auth4.cc
pdns/stubresolver.cc

index b89e50e6d33ea4b5c87fe41cc9e8e0ce8e9195ae..a028d62f7f53c2e400f94edba96aa5f69b4c997d 100644 (file)
@@ -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<DNSZoneRecord> ret;
       std::unordered_map<int, DNSResourceRecord> luaResult;
index 1006618bad127f47965e8daf85443347a443908c..47901aa07582c254cbbb116ec24b4f9531391e2a 100644 (file)
@@ -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()
 {