• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PowerDNS / pdns / 22225698541

20 Feb 2026 01:20PM UTC coverage: 70.913% (-0.7%) from 71.654%
22225698541

Pull #16693

github

web-flow
Merge 12ab81d89 into da25f7afd
Pull Request #16693: auth: plumbing for structured logging

45342 of 79966 branches covered (56.7%)

Branch coverage included in aggregate %.

892 of 2611 new or added lines in 70 files covered. (34.16%)

390 existing lines in 48 files now uncovered.

130608 of 168156 relevant lines covered (77.67%)

7371735.34 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

52.55
/pdns/lua-base4.cc
1
#include "config.h"
2
#include <cassert>
3
#include <fstream>
4
#include <unordered_set>
5
#include <unordered_map>
6
#include <typeinfo>
7
#include <sys/stat.h>
8
#include "logger.hh"
9
#include "logging.hh"
10
#include "iputils.hh"
11
#include "dnsname.hh"
12
#include "dnsparser.hh"
13
#include "dnspacket.hh"
14
#include "namespaces.hh"
15
#include "ednssubnet.hh"
16
#include "lua-base4.hh"
17
#include "ext/luawrapper/include/LuaContext.hpp"
18
#include "dns_random.hh"
19

20
void BaseLua4::loadFile(const std::string& fname, bool doPostLoad)
21
{
579✔
22
  std::ifstream ifs(fname);
579✔
23
  if (!ifs) {
579!
24
    auto ret = errno;
×
25
    auto msg = stringerror(ret);
×
NEW
26
    SLOG(g_log << Logger::Error << "Unable to read configuration file from '" << fname << "': " << msg << endl,
×
NEW
27
         g_slog->withName("lua")->error(Logr::Error, msg, "Unable to read configuration file", "file", Logging::Loggable(fname)));
×
28
    throw std::runtime_error(msg);
×
29
  }
×
30
  loadStream(ifs, doPostLoad);
579✔
31
};
579✔
32

33
void BaseLua4::loadString(const std::string &script) {
2✔
34
  std::istringstream iss(script);
2✔
35
  loadStream(iss, true);
2✔
36
};
2✔
37

38
void BaseLua4::includePath(const std::string& directory) {
×
39
  std::vector<std::string> vec;
×
40
  const std::string& suffix = "lua";
×
41
  auto directoryError = pdns::visit_directory(directory, [this, &directory, &suffix, &vec]([[maybe_unused]] ino_t inodeNumber, const std::string_view& name) {
×
42
    (void)this;
×
43
    if (boost::starts_with(name, ".")) {
×
44
      return true; // skip any dots
×
45
    }
×
46
    if (boost::ends_with(name, suffix)) {
×
47
      // build name
48
      string fullName = directory + "/" + std::string(name);
×
49
      // ensure it's readable file
50
      struct stat statInfo
×
51
      {
×
52
      };
×
53
      if (stat(fullName.c_str(), &statInfo) != 0 || !S_ISREG(statInfo.st_mode)) {
×
54
        string msg = fullName + " is not a regular file";
×
NEW
55
        SLOG(g_log << Logger::Error << msg << std::endl,
×
NEW
56
             g_slog->withName("lua")->info(Logr::Error, "include file is not a regular file", "file", Logging::Loggable(fullName)));
×
57
        throw PDNSException(std::move(msg));
×
58
      }
×
59
      vec.emplace_back(fullName);
×
60
    }
×
61
    return true;
×
62
  });
×
63

64
  if (directoryError) {
×
65
    int err = errno;
×
66
    string msg = directory + " is not accessible: " + stringerror(err);
×
NEW
67
    SLOG(g_log << Logger::Error << msg << std::endl,
×
NEW
68
         g_slog->withName("lua")->error(Logr::Error, err, "Error trying to walk directory", "directory", Logging::Loggable(directory)));
×
69
    throw PDNSException(std::move(msg));
×
70
  }
×
71

72
  std::sort(vec.begin(), vec.end(), CIStringComparePOSIX());
×
73

74
  for(const auto& file: vec) {
×
75
    loadFile(file, false);
×
76
  }
×
77
};
×
78

79
//  By default no features
80
void BaseLua4::getFeatures(Features &) { }
632✔
81

82
void BaseLua4::prepareContext() {
760✔
83
  d_lw = std::make_unique<LuaContext>();
760✔
84

85
  // lua features available
86
  Features features;
760✔
87
  getFeatures(features);
760✔
88
  d_lw->writeVariable("pdns_features", features);
760✔
89

90
  // dnsheader
91
  d_lw->registerFunction<int(dnsheader::*)()>("getID", [](dnsheader& dh) { return ntohs(dh.id); });
760✔
92
  d_lw->registerFunction<bool(dnsheader::*)()>("getCD", [](dnsheader& dh) { return dh.cd; });
760✔
93
  d_lw->registerFunction<bool(dnsheader::*)()>("getTC", [](dnsheader& dh) { return dh.tc; });
760✔
94
  d_lw->registerFunction<bool(dnsheader::*)()>("getRA", [](dnsheader& dh) { return dh.ra; });
760✔
95
  d_lw->registerFunction<bool(dnsheader::*)()>("getAD", [](dnsheader& dh) { return dh.ad; });
760✔
96
  d_lw->registerFunction<bool(dnsheader::*)()>("getAA", [](dnsheader& dh) { return dh.aa; });
760✔
97
  d_lw->registerFunction<bool(dnsheader::*)()>("getRD", [](dnsheader& dh) { return dh.rd; });
760✔
98
  d_lw->registerFunction<int(dnsheader::*)()>("getRCODE", [](dnsheader& dh) { return dh.rcode; });
760✔
99
  d_lw->registerFunction<int(dnsheader::*)()>("getOPCODE", [](dnsheader& dh) { return dh.opcode; });
760✔
100
  d_lw->registerFunction<int(dnsheader::*)()>("getQDCOUNT", [](dnsheader& dh) { return ntohs(dh.qdcount); });
760✔
101
  d_lw->registerFunction<int(dnsheader::*)()>("getANCOUNT", [](dnsheader& dh) { return ntohs(dh.ancount); });
760✔
102
  d_lw->registerFunction<int(dnsheader::*)()>("getNSCOUNT", [](dnsheader& dh) { return ntohs(dh.nscount); });
760✔
103
  d_lw->registerFunction<int(dnsheader::*)()>("getARCOUNT", [](dnsheader& dh) { return ntohs(dh.arcount); });
760✔
104

105
  // DNSName
106
  d_lw->writeFunction("newDN", [](const std::string& dom){ return DNSName(dom); });
97,696✔
107
  d_lw->registerFunction("__lt", &DNSName::operator<);
760✔
108
  d_lw->registerFunction<bool(DNSName::*)(const DNSName&)>("canonCompare", [](const DNSName& name, const DNSName& rhs) { return name.canonCompare(rhs); });
994✔
109
  d_lw->registerFunction<DNSName(DNSName::*)(const DNSName&)>("makeRelative", [](const DNSName& name, const DNSName& zone) { return name.makeRelative(zone); });
790✔
110
  d_lw->registerFunction<bool(DNSName::*)(const DNSName&)>("isPartOf", [](const DNSName& name, const DNSName& rhs) { return name.isPartOf(rhs); });
851✔
111
  d_lw->registerFunction("getRawLabels", &DNSName::getRawLabels);
760✔
112
  d_lw->registerFunction<unsigned int(DNSName::*)()>("countLabels", [](const DNSName& name) { return name.countLabels(); });
760✔
113
  d_lw->registerFunction<size_t(DNSName::*)()>("wireLength", [](const DNSName& name) { return name.wirelength(); });
760✔
114
  d_lw->registerFunction<size_t(DNSName::*)()>("wirelength", [](const DNSName& name) { return name.wirelength(); });
760✔
115
  d_lw->registerFunction<bool(DNSName::*)(const std::string&)>("equal", [](const DNSName& lhs, const std::string& rhs) { return lhs==DNSName(rhs); });
760✔
116
  d_lw->registerEqFunction(&DNSName::operator==);
760✔
117
  d_lw->registerToStringFunction<string(DNSName::*)()>([](const DNSName&dn ) { return dn.toString(); });
760✔
118
  d_lw->registerFunction<string(DNSName::*)()>("toString", [](const DNSName&dn ) { return dn.toString(); });
760✔
119
  d_lw->registerFunction<string(DNSName::*)()>("toStringNoDot", [](const DNSName&dn ) { return dn.toStringNoDot(); });
760✔
120
  d_lw->registerFunction<bool(DNSName::*)()>("chopOff", [](DNSName&dn ) { return dn.chopOff(); });
760✔
121

122
  // DNSResourceRecord
123
  d_lw->writeFunction("newDRR", [](const DNSName& qname, const string& qtype, const unsigned int ttl, const string& content, boost::optional<int> domain_id, boost::optional<int> auth){
760✔
124
    auto drr = DNSResourceRecord();
×
125
    drr.qname = qname;
×
126
    drr.qtype = qtype;
×
127
    drr.ttl = ttl;
×
128
    drr.setContent(content);
×
129
    if (domain_id)
×
130
      drr.domain_id = *domain_id;
×
131
    if (auth)
×
132
      drr.auth = *auth;
×
133
     return drr;
×
134
  });
×
135
  d_lw->registerEqFunction(&DNSResourceRecord::operator==);
760✔
136
  d_lw->registerFunction("__lt", &DNSResourceRecord::operator<);
760✔
137
  d_lw->registerToStringFunction<string(DNSResourceRecord::*)()>([](const DNSResourceRecord& rec) { return rec.getZoneRepresentation(); });
760✔
138
  d_lw->registerFunction<string(DNSResourceRecord::*)()>("toString", [](const DNSResourceRecord& rec) { return rec.getZoneRepresentation();} );
760✔
139
  d_lw->registerFunction<DNSName(DNSResourceRecord::*)()>("qname", [](DNSResourceRecord& rec) { return rec.qname; });
760✔
140
  d_lw->registerFunction<DNSName(DNSResourceRecord::*)()>("wildcardName", [](DNSResourceRecord& rec) { return rec.wildcardname; });
760✔
141
  d_lw->registerFunction<string(DNSResourceRecord::*)()>("content", [](DNSResourceRecord& rec) { return rec.content; });
760✔
142
  d_lw->registerFunction<time_t(DNSResourceRecord::*)()>("lastModified", [](DNSResourceRecord& rec) { return rec.last_modified; });
760✔
143
  d_lw->registerFunction<uint32_t(DNSResourceRecord::*)()>("ttl", [](DNSResourceRecord& rec) { return rec.ttl; });
760✔
144
  d_lw->registerFunction<uint32_t(DNSResourceRecord::*)()>("signttl", [](DNSResourceRecord& rec) { return rec.signttl; });
760✔
145
  d_lw->registerFunction<int(DNSResourceRecord::*)()>("domainId", [](DNSResourceRecord& rec) { return rec.domain_id; });
760✔
146
  d_lw->registerFunction<uint16_t(DNSResourceRecord::*)()>("qtype", [](DNSResourceRecord& rec) { return rec.qtype.getCode(); });
760✔
147
  d_lw->registerFunction<uint16_t(DNSResourceRecord::*)()>("qclass", [](DNSResourceRecord& rec) { return rec.qclass; });
760✔
148
  d_lw->registerFunction<uint8_t(DNSResourceRecord::*)()>("scopeMask", [](DNSResourceRecord& rec) { return rec.scopeMask; });
760✔
149
  d_lw->registerFunction<bool(DNSResourceRecord::*)()>("auth", [](DNSResourceRecord& rec) { return rec.auth; });
760✔
150
  d_lw->registerFunction<bool(DNSResourceRecord::*)()>("disabled", [](DNSResourceRecord& rec) { return rec.disabled; });
760✔
151

152
  // ComboAddress
153
  d_lw->registerFunction<bool(ComboAddress::*)()>("isIPv4", [](const ComboAddress& addr) { return addr.sin4.sin_family == AF_INET; });
760✔
154
  d_lw->registerFunction<bool(ComboAddress::*)()>("isIPv6", [](const ComboAddress& addr) { return addr.sin4.sin_family == AF_INET6; });
760✔
155
  d_lw->registerFunction<uint16_t(ComboAddress::*)()>("getPort", [](const ComboAddress& addr) { return ntohs(addr.sin4.sin_port); } );
760✔
156
  d_lw->registerFunction<bool(ComboAddress::*)()>("isMappedIPv4", [](const ComboAddress& addr) { return addr.isMappedIPv4(); });
760✔
157
  d_lw->registerFunction<ComboAddress(ComboAddress::*)()>("mapToIPv4", [](const ComboAddress& addr) { return addr.mapToIPv4(); });
760✔
158
  d_lw->registerFunction<void(ComboAddress::*)(unsigned int)>("truncate", [](ComboAddress& addr, unsigned int bits) { addr.truncate(bits); });
760✔
159
  d_lw->registerFunction<string(ComboAddress::*)()>("toString", [](const ComboAddress& addr) { return addr.toString(); });
760✔
160
  d_lw->registerToStringFunction<string(ComboAddress::*)()>([](const ComboAddress& addr) { return addr.toString(); });
97,446✔
161
  d_lw->registerFunction<string(ComboAddress::*)()>("toStringWithPort", [](const ComboAddress& addr) { return addr.toStringWithPort(); });
760✔
162
  d_lw->registerFunction<string(ComboAddress::*)()>("getRaw", [](const ComboAddress& addr) { return addr.toByteString(); });
760✔
163

164
  d_lw->writeFunction("newCA", [](const std::string& a) { return ComboAddress(a); });
760✔
165
  d_lw->writeFunction("newCAFromRaw", [](const std::string& raw, boost::optional<uint16_t> port) {
760✔
166
                                        if (raw.size() == 4) {
×
167
                                          struct sockaddr_in sin4;
×
168
                                          memset(&sin4, 0, sizeof(sin4));
×
169
                                          sin4.sin_family = AF_INET;
×
170
                                          memcpy(&sin4.sin_addr.s_addr, raw.c_str(), raw.size());
×
171
                                          if (port) {
×
172
                                            sin4.sin_port = htons(*port);
×
173
                                          }
×
174
                                          return ComboAddress(&sin4);
×
175
                                        }
×
176
                                        else if (raw.size() == 16) {
×
177
                                          struct sockaddr_in6 sin6;
×
178
                                          memset(&sin6, 0, sizeof(sin6));
×
179
                                          sin6.sin6_family = AF_INET6;
×
180
                                          memcpy(&sin6.sin6_addr.s6_addr, raw.c_str(), raw.size());
×
181
                                          if (port) {
×
182
                                            sin6.sin6_port = htons(*port);
×
183
                                          }
×
184
                                          return ComboAddress(&sin6);
×
185
                                        }
×
186
                                        return ComboAddress();
×
187
                                      });
×
188
  typedef std::unordered_set<ComboAddress,ComboAddress::addressOnlyHash,ComboAddress::addressOnlyEqual> cas_t;
760✔
189
  d_lw->registerFunction<bool(ComboAddress::*)(const ComboAddress&)>("equal", [](const ComboAddress& lhs, const ComboAddress& rhs) { return ComboAddress::addressOnlyEqual()(lhs, rhs); });
760✔
190

191
  // cas_t
192
  d_lw->writeFunction("newCAS", []{ return cas_t(); });
760✔
193
  d_lw->registerFunction<void(cas_t::*)(boost::variant<string,ComboAddress, vector<pair<unsigned int,string> > >)>("add",
760✔
194
    [](cas_t& cas, const boost::variant<string,ComboAddress,vector<pair<unsigned int,string> > >& in)
760✔
195
    {
760✔
196
      try {
×
197
      if(auto s = boost::get<string>(&in)) {
×
198
        cas.insert(ComboAddress(*s));
×
199
      }
×
200
      else if(auto v = boost::get<vector<pair<unsigned int, string> > >(&in)) {
×
201
        for(const auto& str : *v)
×
202
          cas.insert(ComboAddress(str.second));
×
203
      }
×
204
      else
×
205
        cas.insert(boost::get<ComboAddress>(in));
×
206
      }
×
207
      catch(std::exception& e) {
×
208
        SLOG(g_log <<Logger::Error<<e.what()<<endl,
×
209
             g_slog->withName("lua")->error(Logr::Error, e.what(), "Exception in newCAS", "exception", Logging::Loggable("std::exception")));
×
210
      }
×
211
    });
×
212
  d_lw->registerFunction<bool(cas_t::*)(const ComboAddress&)>("check",[](const cas_t& cas, const ComboAddress&ca) { return cas.count(ca)>0; });
760✔
213

214
  // QType
215
  d_lw->writeFunction("newQType", [](const string& s) { QType q; q = s; return q; });
806✔
216
  d_lw->registerFunction("getCode", &QType::getCode);
760✔
217
  d_lw->registerFunction("getName", &QType::toString);
760✔
218
  d_lw->registerEqFunction<bool(QType::*)(const QType&)>([](const QType& a, const QType& b){ return a == b;}); // operator overloading confuses LuaContext
760✔
219
  d_lw->registerToStringFunction(&QType::toString);
760✔
220

221
  // Netmask
222
  d_lw->writeFunction("newNetmask", [](const string& s) { return Netmask(s); });
760✔
223
  d_lw->registerFunction<ComboAddress(Netmask::*)()>("getNetwork", [](const Netmask& nm) { return nm.getNetwork(); } ); // const reference makes this necessary
760✔
224
  d_lw->registerFunction<ComboAddress(Netmask::*)()>("getMaskedNetwork", [](const Netmask& nm) { return nm.getMaskedNetwork(); } );
760✔
225
  d_lw->registerFunction("isIpv4", &Netmask::isIPv4);
760✔
226
  d_lw->registerFunction("isIPv4", &Netmask::isIPv4);
760✔
227
  d_lw->registerFunction("isIpv6", &Netmask::isIPv6);
760✔
228
  d_lw->registerFunction("isIPv6", &Netmask::isIPv6);
760✔
229
  d_lw->registerFunction("getBits", &Netmask::getBits);
760✔
230
  d_lw->registerFunction("toString", &Netmask::toString);
760✔
231
  d_lw->registerFunction("empty", &Netmask::empty);
760✔
232
  d_lw->registerFunction("match", (bool (Netmask::*)(const string&) const)&Netmask::match);
760✔
233
  d_lw->registerEqFunction(&Netmask::operator==);
760✔
234
  d_lw->registerToStringFunction(&Netmask::toString);
760✔
235

236
  // NetmaskGroup
237
  d_lw->writeFunction("newNMG", [](boost::optional<vector<pair<unsigned int, std::string>>> masks) {
760✔
238
    auto nmg = NetmaskGroup();
7✔
239

240
    if (masks) {
7!
241
      for(const auto& mask: *masks) {
×
242
        nmg.addMask(mask.second);
×
243
      }
×
244
    }
×
245

246
    return nmg;
7✔
247
  });
7✔
248
  // d_lw->writeFunction("newNMG", []() { return NetmaskGroup(); });
249
  d_lw->registerFunction<void(NetmaskGroup::*)(const std::string&mask)>("addMask", [](NetmaskGroup&nmg, const std::string& mask) { nmg.addMask(mask); });
760✔
250
  d_lw->registerFunction<void(NetmaskGroup::*)(const vector<pair<unsigned int, std::string>>&)>("addMasks", [](NetmaskGroup&nmg, const vector<pair<unsigned int, std::string>>& masks) { for(const auto& mask: masks) { nmg.addMask(mask.second); } });
760!
251
  d_lw->registerFunction("match", (bool (NetmaskGroup::*)(const ComboAddress&) const)&NetmaskGroup::match);
760✔
252

253
  // DNSRecord
254
  d_lw->writeFunction("newDR", [](const DNSName& name, const std::string& type, unsigned int ttl, const std::string& content, int place) { QType qtype; qtype = type; auto dr = DNSRecord(); dr.d_name = name; dr.d_type = qtype.getCode(); dr.d_ttl = ttl; dr.setContent(shared_ptr<DNSRecordContent>(DNSRecordContent::make(dr.d_type, QClass::IN, content))); dr.d_place = static_cast<DNSResourceRecord::Place>(place); return dr; });
760✔
255
  d_lw->registerMember("name", &DNSRecord::d_name);
760✔
256
  d_lw->registerMember("type", &DNSRecord::d_type);
760✔
257
  d_lw->registerMember("ttl", &DNSRecord::d_ttl);
760✔
258
  d_lw->registerMember("place", &DNSRecord::d_place);
760✔
259
  d_lw->registerFunction<string(DNSRecord::*)()>("getContent", [](const DNSRecord& dr) { return dr.getContent()->getZoneRepresentation(); });
760✔
260
  d_lw->registerFunction<boost::optional<ComboAddress>(DNSRecord::*)()>("getCA", [](const DNSRecord& dr) {
760✔
261
      boost::optional<ComboAddress> ret;
×
262

263
      if(auto arec = getRR<ARecordContent>(dr))
×
264
        ret=arec->getCA(53);
×
265
      else if(auto aaaarec = getRR<AAAARecordContent>(dr))
×
266
        ret=aaaarec->getCA(53);
×
267
      return ret;
×
268
    });
×
269
  d_lw->registerFunction<void (DNSRecord::*)(const std::string&)>("changeContent", [](DNSRecord& dr, const std::string& newContent) { dr.setContent(shared_ptr<DNSRecordContent>(DNSRecordContent::make(dr.d_type, 1, newContent))); });
760✔
270

271
  // pdnslog
272
#if defined(PDNS_AUTH)||defined(RECURSOR)
760✔
273
  d_lw->writeFunction("pdnslog", [](const std::string& msg, boost::optional<int> loglevel, boost::optional<std::map<std::string, std::string>> values) {
760✔
274
    auto log = g_slog->withName("lua");
24✔
275
    if (values) {
24!
UNCOV
276
      for (const auto& [key, value] : *values) {
×
UNCOV
277
        log = log->withValues(key, Logging::Loggable(value));
×
UNCOV
278
      }
×
UNCOV
279
    }
×
280
    log->info(static_cast<Logr::Priority>(loglevel.get_value_or(Logr::Warning)), msg);
24✔
281
#else
282
    d_lw->writeFunction("pdnslog", [](const std::string& msg, boost::optional<int> loglevel) {
283
      g_log << (Logger::Urgency)loglevel.get_value_or(Logger::Warning) << msg<<endl;
284
#endif
285
  });
24✔
286

287
  d_lw->writeFunction("pdnsrandom", [](boost::optional<uint32_t> maximum) {
760✔
288
    return maximum ? dns_random(*maximum) : dns_random_uint32();
2!
289
  });
2✔
290

291
  // certain constants
292

293
  vector<pair<string, int> > rcodes = {{"NOERROR",  RCode::NoError  },
760✔
294
                                       {"FORMERR",  RCode::FormErr  },
760✔
295
                                       {"SERVFAIL", RCode::ServFail },
760✔
296
                                       {"NXDOMAIN", RCode::NXDomain },
760✔
297
                                       {"NOTIMP",   RCode::NotImp   },
760✔
298
                                       {"REFUSED",  RCode::Refused  },
760✔
299
                                       {"YXDOMAIN", RCode::YXDomain },
760✔
300
                                       {"YXRRSET",  RCode::YXRRSet  },
760✔
301
                                       {"NXRRSET",  RCode::NXRRSet  },
760✔
302
                                       {"NOTAUTH",  RCode::NotAuth  },
760✔
303
                                       {"NOTZONE",  RCode::NotZone  },
760✔
304
                                       {"DROP",    -2               }}; // To give backport-incompatibility warning
760✔
305
  for(const auto& rcode : rcodes)
760✔
306
    d_pd.push_back({rcode.first, rcode.second});
9,101✔
307

308
  d_pd.push_back({"place", in_t{
760✔
309
    {"QUESTION", 0},
760✔
310
    {"ANSWER", 1},
760✔
311
    {"AUTHORITY", 2},
760✔
312
    {"ADDITIONAL", 3}
760✔
313
  }});
760✔
314

315
  d_pd.push_back({"loglevels", in_t{
760✔
316
        {"Alert", LOG_ALERT},
760✔
317
        {"Critical", LOG_CRIT},
760✔
318
        {"Debug", LOG_DEBUG},
760✔
319
        {"Emergency", LOG_EMERG},
760✔
320
        {"Info", LOG_INFO},
760✔
321
        {"Notice", LOG_NOTICE},
760✔
322
        {"Warning", LOG_WARNING},
760✔
323
        {"Error", LOG_ERR}
760✔
324
          }});
760✔
325

326
  for(const auto& n : QType::names)
760✔
327
    d_pd.push_back({n.first, n.second});
50,995✔
328

329
  d_lw->registerMember("tv_sec", &timeval::tv_sec);
760✔
330
  d_lw->registerMember("tv_usec", &timeval::tv_usec);
760✔
331

332
  postPrepareContext();
760✔
333

334
  // so we can let postprepare do changes to this
335
  d_lw->writeVariable("pdns", d_pd);
760✔
336
}
760✔
337

338
void BaseLua4::loadStream(std::istream &stream, bool doPostLoad) {
581✔
339
  d_lw->executeCode(stream);
581✔
340

341
  if (doPostLoad) {
581!
342
    postLoad();
581✔
343
  }
581✔
344
}
581✔
345

346
BaseLua4::~BaseLua4() = default;
305✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc