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

PowerDNS / pdns / 18679017918

21 Oct 2025 09:15AM UTC coverage: 69.743% (+2.0%) from 67.713%
18679017918

Pull #16307

github

web-flow
Merge ba88af487 into da98764c6
Pull Request #16307: rec: explicit disabling/enabling of tls-gnutls for full and least configs and packages

26192 of 45526 branches covered (57.53%)

Branch coverage included in aggregate %.

6 of 6 new or added lines in 1 file covered. (100.0%)

2282 existing lines in 57 files now uncovered.

86265 of 115719 relevant lines covered (74.55%)

4323875.05 hits per line

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

89.93
/pdns/version.cc
1
/*
2
 * This file is part of PowerDNS or dnsdist.
3
 * Copyright -- PowerDNS.COM B.V. and its contributors
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of version 2 of the GNU General Public License as
7
 * published by the Free Software Foundation.
8
 *
9
 * In addition, for the avoidance of any doubt, permission is granted to
10
 * link this program with OpenSSL and to (re)distribute the binaries
11
 * produced as the result of such linking.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
 */
22

23
#include "config.h"
24
#include "version.hh"
25
#include "namespaces.hh"
26

27
#ifdef PDNS_MODULES
28
#include "dnsbackend.hh"
29
#endif
30

31
#include <sstream>
32
#include <boost/algorithm/string/join.hpp>
33

34
static ProductType productType;
35

36
string compilerVersion()
37
{
276✔
38
#if defined(__clang__)
276✔
39
  return "clang " __clang_version__;
276✔
40
#elif defined(__GNUC__)
41
  return "gcc " __VERSION__;
42
#else // add other compilers here
43
  return "Unknown compiler";
44
#endif
45
}
276✔
46

47
// Human-readable product name
48
string productName()
49
{
280✔
50
  switch (productType) {
280!
51
  case ProductAuthoritative:
280!
52
    return "PowerDNS Authoritative Server";
280✔
UNCOV
53
  case ProductRecursor:
×
UNCOV
54
    return "PowerDNS Recursor";
×
55
  };
280✔
56
  return "Unknown";
×
57
}
280✔
58

59
string getPDNSVersion()
60
{
177✔
61
  return VERSION;
177✔
62
}
177✔
63

64
// REST API product type
65
string productTypeApiType()
66
{
8✔
67
  switch (productType) {
8!
68
  case ProductAuthoritative:
8!
69
    return "authoritative";
8✔
70
  case ProductRecursor:
×
71
    return "recursor";
×
72
  };
8✔
73
  return "unknown";
×
74
}
8✔
75

76
vector<string> getProductVersionLines()
77
{
169✔
78
  vector<string> ret;
169✔
79
  std::istringstream istr(getProductVersion());
169✔
80
  for (string line; std::getline(istr, line);) {
676✔
81
    ret.emplace_back(line);
507✔
82
  }
507✔
83
  return ret;
169✔
84
}
169✔
85

86
string getProductVersion()
87
{
276✔
88
  ostringstream ret;
276✔
89
  ret << productName() << " " << VERSION << " (C) "
276✔
90
                                            "PowerDNS.COM BV"
276✔
91
      << endl;
276✔
92
  ret << "Using " << (sizeof(unsigned long) * 8) << "-bits mode. "
276✔
93
                                                    "Built using "
276✔
94
      << compilerVersion()
276✔
95
#ifndef REPRODUCIBLE
276✔
96
      << " on " __DATE__ " " __TIME__ " by " BUILD_HOST
276✔
97
#endif
276✔
98
      << "." << endl;
276✔
99
  ret << "PowerDNS comes with ABSOLUTELY NO WARRANTY. "
276✔
100
         "This is free software, and you are welcome to redistribute it "
276✔
101
         "according to the terms of the GPL version 2."
276✔
102
      << endl;
276✔
103
  return ret.str();
276✔
104
}
276✔
105

106
string getBuildConfiguration()
107
{
107✔
108
  ostringstream ret;
107✔
109
  ret << "Features:"
107✔
110
#ifdef HAVE_LIBCRYPTO_ECDSA
107✔
111
      << " libcrypto-ecdsa"
107✔
112
#endif
107✔
113
#ifdef HAVE_LIBCRYPTO_ED25519
107✔
114
      << " libcrypto-ed25519"
107✔
115
#endif
107✔
116
#ifdef HAVE_LIBCRYPTO_ED448
107✔
117
      << " libcrypto-ed448"
107✔
118
#endif
107✔
119
#ifdef HAVE_LIBCRYPTO_EDDSA
107✔
120
      << " libcrypto-eddsa"
107✔
121
#endif
107✔
122
#ifdef HAVE_LIBDL
123
      << " libdl"
124
#endif
125
#ifdef HAVE_GEOIP
107✔
126
      << " libgeoip"
107✔
127
#endif
107✔
128
#ifdef HAVE_MMDB
107✔
129
      << " libmaxminddb"
107✔
130
#endif
107✔
131
#ifdef HAVE_LUA
107✔
132
      << " lua"
107✔
133
#endif
107✔
134
#ifdef HAVE_LUA_RECORDS
107✔
135
      << " lua-records"
107✔
136
#endif
107✔
137
#ifdef NOD_ENABLED
138
      << " nod"
139
#endif
140
#ifdef HAVE_P11KIT1
107✔
141
      << " PKCS#11"
107✔
142
#endif
107✔
143
      << " protobuf"
107✔
144
#ifdef HAVE_FSTRM
145
      << " dnstap-framestream"
146
#endif
147
#ifdef REMOTEBACKEND_ZEROMQ
107✔
148
      << " remotebackend-zeromq"
107✔
149
#endif
107✔
150
#ifdef HAVE_NET_SNMP
151
      << " snmp"
152
#endif
153
#ifdef HAVE_LIBSODIUM
107✔
154
      << " sodium"
107✔
155
#endif
107✔
156
#ifdef HAVE_LIBSSL
107✔
157
      << " libssl"
107✔
158
#endif
107✔
159
#ifdef HAVE_GNUTLS
107✔
160
      << " gnutls"
107✔
161
#endif
107✔
162
#ifdef HAVE_LIBCURL
107✔
163
      << " curl"
107✔
164
#endif
107✔
165
#ifdef HAVE_DNS_OVER_TLS
107✔
166
      << " DoT"
107✔
167
#endif
107✔
168
#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
107✔
169
      << " scrypt"
107✔
170
#endif
107✔
171
#ifdef ENABLE_GSS_TSIG
107✔
172
      << " gss-tsig"
107✔
173
#endif
107✔
174
#ifdef VERBOSELOG
175
      << " verboselog"
176
#endif
177
#ifdef HAVE_LIBCAP
178
      << " libcap"
179
#endif
180
      << endl;
107✔
181
#ifdef PDNS_MODULES
107✔
182
  // Auth only
183
  ret << "Built-in modules: " << PDNS_MODULES << endl;
107✔
184
  const auto& modules = BackendMakers().getModules();
107✔
185
  ret << "Loaded modules: " << boost::join(modules, " ") << endl;
107✔
186
#endif
107✔
187
// NOLINTBEGIN(cppcoreguidelines-macro-usage)
188
#ifdef PDNS_CONFIG_ARGS
107✔
189
#define double_escape(s) #s
107✔
190
#define escape_quotes(s) double_escape(s)
107✔
191
  // NOLINTEND(cppcoreguidelines-macro-usage)
192
  ret << "Configured with: " << escape_quotes(PDNS_CONFIG_ARGS) << endl;
107✔
193
#undef escape_quotes
107✔
194
#undef double_escape
107✔
195
#endif
107✔
196
  return ret.str();
107✔
197
}
107✔
198

199
string fullVersionString()
200
{
4✔
201
  ostringstream ret;
4✔
202
  ret << productName() << " " VERSION;
4✔
203
#ifndef REPRODUCIBLE
4✔
204
  ret << " (built " __DATE__ " " __TIME__ " by " BUILD_HOST ")";
4✔
205
#endif
4✔
206
  return ret.str();
4✔
207
}
4✔
208

209
void versionSetProduct(ProductType productType_)
210
{
278✔
211
  productType = productType_;
278✔
212
}
278✔
213

214
ProductType versionGetProduct()
215
{
×
216
  return productType;
×
217
}
×
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