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

PowerDNS / pdns / 18776176249

24 Oct 2025 09:51AM UTC coverage: 73.028% (+15.6%) from 57.383%
18776176249

Pull #16370

github

web-flow
Merge 0f309894e into 39f7f1b27
Pull Request #16370: auth: xfr churning

38273 of 63104 branches covered (60.65%)

Branch coverage included in aggregate %.

186 of 264 new or added lines in 1 file covered. (70.45%)

14471 existing lines in 217 files now uncovered.

127487 of 163878 relevant lines covered (77.79%)

5632363.83 hits per line

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

64.94
/pdns/recursordist/validate-recursor.cc
1
#include "validate.hh"
2
#include "validate-recursor.hh"
3
#include "syncres.hh"
4
#include "logger.hh"
5
#include "rec-lua-conf.hh"
6
#include "dnssecinfra.hh"
7
#include "dnssec.hh"
8
#include "zoneparser-tng.hh"
9
#include "rec-tcounters.hh"
10

11
DNSSECMode g_dnssecmode{DNSSECMode::ProcessNoValidate};
12
bool g_dnssecLogBogus;
13

14
bool checkDNSSECDisabled()
15
{
1✔
16
  return g_dnssecmode == DNSSECMode::Off;
1✔
17
}
1✔
18

19
bool warnIfDNSSECDisabled(const string& msg)
20
{
3✔
21
  if (g_dnssecmode == DNSSECMode::Off) {
3!
22
    if (!msg.empty()) {
×
23
      auto log = g_slog->withName("config");
×
24
      log->info(Logr::Warning, msg);
×
25
    }
×
26
    return true;
×
27
  }
×
28
  return false;
3✔
29
}
3✔
30

31
vState increaseDNSSECStateCounter(const vState& state)
32
{
3,322✔
33
  t_Counters.at(rec::DNSSECHistogram::dnssec).at(state)++;
3,322✔
34
  return state;
3,322✔
35
}
3,322✔
36

37
vState increaseXDNSSECStateCounter(const vState& state)
UNCOV
38
{
×
39
  t_Counters.at(rec::DNSSECHistogram::xdnssec).at(state)++;
×
40
  return state;
×
41
}
×
42

43
// Returns true if dsAnchors were modified
44
bool updateTrustAnchorsFromFile(const std::string& fname, map<DNSName, dsset_t>& dsAnchors, Logr::log_t log)
45
{
1✔
46
  map<DNSName, dsset_t> newDSAnchors;
1✔
47
  try {
1✔
48
    auto zoneParser = ZoneParserTNG(fname);
1✔
49
    zoneParser.disableGenerate();
1✔
50
    DNSResourceRecord resourceRecord;
1✔
51
    DNSRecord dnsrecord;
1✔
52
    while (zoneParser.get(resourceRecord)) {
4✔
53
      dnsrecord = DNSRecord(resourceRecord);
3✔
54
      if (resourceRecord.qtype == QType::DS) {
3✔
55
        auto dsr = getRR<DSRecordContent>(dnsrecord);
1✔
56
        if (dsr == nullptr) {
1!
57
          throw PDNSException("Unable to parse DS record '" + resourceRecord.qname.toString() + " " + resourceRecord.getZoneRepresentation() + "'");
×
58
        }
×
59
        newDSAnchors[resourceRecord.qname].insert(*dsr);
1✔
60
      }
1✔
61
      if (resourceRecord.qtype == QType::DNSKEY) {
3✔
62
        auto dnskeyr = getRR<DNSKEYRecordContent>(dnsrecord);
1✔
63
        if (dnskeyr == nullptr) {
1!
64
          throw PDNSException("Unable to parse DNSKEY record '" + resourceRecord.qname.toString() + " " + resourceRecord.getZoneRepresentation() + "'");
×
65
        }
×
66
        auto dsr = makeDSFromDNSKey(resourceRecord.qname, *dnskeyr, DNSSEC::DIGEST_SHA256);
1✔
67
        newDSAnchors[resourceRecord.qname].insert(std::move(dsr));
1✔
68
      }
1✔
69
    }
3✔
70
    if (dsAnchors == newDSAnchors) {
1!
71
      log->info(Logr::Debug, "Read Trust Anchors from file, no changes detected");
×
72
      return false;
×
73
    }
×
74
    log->info(Logr::Info, "Read changed Trust Anchors from file, updating");
1✔
75
    dsAnchors = std::move(newDSAnchors);
1✔
76
    return true;
1✔
77
  }
1✔
78
  catch (const std::exception& e) {
1✔
79
    throw PDNSException("Error while reading Trust Anchors from file '" + fname + "': " + e.what());
×
80
  }
×
81
  catch (...) {
1✔
82
    throw PDNSException("Error while reading Trust Anchors from file '" + fname + "'");
×
83
  }
×
84
}
1✔
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

© 2025 Coveralls, Inc