]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
pdns: remove randombackend 10484/head
authorKees Monshouwer <mind04@monshouwer.org>
Thu, 3 Jun 2021 07:11:19 +0000 (09:11 +0200)
committermind04 <mind04@monshouwer.org>
Fri, 10 Sep 2021 08:58:47 +0000 (10:58 +0200)
18 files changed:
.circleci/config.yml
.github/workflows/codeql-analysis.yml
Dockerfile-auth
builder-support/debian/authoritative/debian-buster/pdns-server.install
builder-support/debian/authoritative/debian-buster/rules
builder-support/specs/pdns.spec
configure.ac
docs/appendices/backend-writers-guide.rst
docs/backends/random.rst
modules/Makefile.am
modules/randombackend/Makefile.am [deleted file]
modules/randombackend/OBJECTFILES [deleted file]
modules/randombackend/OBJECTLIBS [deleted file]
modules/randombackend/randombackend.cc [deleted file]
regression-tests.nobackend/counters/command
regression-tests.nobackend/counters/expected_result
regression-tests.nobackend/counters/named.conf [new file with mode: 0644]
tasks.py

index e52d2307feacbd12b086c28c9a1d62671ce6a413..27c2a1d9fda532bfd154fbd1e472c24a6ab07374 100644 (file)
@@ -596,7 +596,7 @@ jobs:
             CXXFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int -Wp,-D_GLIBCXX_ASSERTIONS" \
             ./configure \
               --enable-option-checking=fatal \
-              --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe random remote tinydns' \
+              --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe remote tinydns' \
               --enable-systemd \
               --enable-tools \
               --enable-unit-tests \
@@ -1491,7 +1491,7 @@ jobs:
             ./configure \
               --enable-option-checking=fatal \
               --disable-systemd \
-              --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc random tinydns' \
+              --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc tinydns' \
               --enable-tools \
               --with-lmdb=/usr \
               --with-libsodium \
index 4223620ecdab69688f988b77248d9e5f92540b1b..a035dbd8dea5704a7f0a774df7561f906d352afa 100644 (file)
@@ -99,7 +99,7 @@ jobs:
       if: matrix.product == 'auth'
       run: |
         autoreconf -vfi
-        ./configure --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe random remote tinydns' --enable-tools --enable-ixfrdist --enable-dns-over-tls --enable-experimental-pkcs11 --with-libsodium --enable-lua-records CFLAGS='-O0' CXXFLAGS='-O0'
+        ./configure --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe remote tinydns' --enable-tools --enable-ixfrdist --enable-dns-over-tls --enable-experimental-pkcs11 --with-libsodium --enable-lua-records CFLAGS='-O0' CXXFLAGS='-O0'
         make -j8 -C ext
         make -j8 -C modules
         make -j8 -C pdns
index 8ba2945f4970f417bfe186a58d85705a1cd1a122..268c779e027ba202a2f27b342e4169f7af44a82c 100644 (file)
@@ -50,7 +50,7 @@ RUN mkdir /build && \
       --with-lua=${LUAVER} \
       --sysconfdir=/etc/powerdns \
       --enable-option-checking=fatal \
-      --with-dynmodules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe random remote tinydns' \
+      --with-dynmodules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe remote tinydns' \
       --enable-tools \
       --enable-ixfrdist \
       --with-unixodbc-lib=/usr/lib/$(dpkg-architecture -q DEB_BUILD_GNU_TYPE) && \
index 74350bd6276bed6fab6421d3c5ccfe6d806c7333..480243ecc246a7e24d399d572d3daf0698be2969 100644 (file)
@@ -3,5 +3,4 @@ usr/bin/pdns_control
 usr/bin/pdnsutil
 usr/bin/zone2json
 usr/bin/zone2sql
-usr/lib/*/pdns/librandombackend.so*
 usr/sbin/pdns_server
index 50d6ffe0337677d18d87b58a74800c8c2f001eb3..5dd51f643b527f5c477e0bc79371e3e327751efa 100755 (executable)
@@ -10,7 +10,7 @@ include /usr/share/dpkg/default.mk
 export PDNS_TEST_NO_IPV6=1
 
 # Backends
-backends := bind ldap lmdb lua2 pipe gmysql godbc gpgsql gsqlite3 geoip remote random tinydns
+backends := bind ldap lmdb lua2 pipe gmysql godbc gpgsql gsqlite3 geoip remote tinydns
 
 
 %:
index 3dc25bcfec291fd6c2909a8624366b8d12307c88..e0b29c15fd0989685473efadd0153ba072a881ad 100644 (file)
@@ -190,7 +190,7 @@ export CPPFLAGS="-DLDAP_DEPRECATED"
   --disable-silent-rules \
   --with-modules='' \
   --with-lua=%{lua_implementation} \
-  --with-dynmodules='%{backends} random' \
+  --with-dynmodules='%{backends}' \
   --enable-tools \
   --with-libsodium \
 %if 0%{?amzn} != 2
@@ -265,7 +265,6 @@ systemctl daemon-reload ||:
 %{_bindir}/zone2json
 %{_bindir}/zone2sql
 %{_libdir}/%{name}/libbindbackend.so
-%{_libdir}/%{name}/librandombackend.so
 %{_mandir}/man1/pdns-zone2ldap.1.gz
 %{_mandir}/man1/pdns_control.1.gz
 %{_mandir}/man1/pdns_server.1.gz
index af50e9927f299e0a198b7e4f5039bc71d2e66cde..249f2cdb39889e4c91b1ec0634e29384afe15124 100644 (file)
@@ -169,9 +169,9 @@ AC_ARG_WITH([socketdir],
   [socketdir="$withval"]
 )
 
-modules="bind gmysql random"
+modules="bind gmysql"
 AC_ARG_WITH([modules],
-  [AS_HELP_STRING([--with-modules], [which backends to compile with @<:@default=bind gmysql random@:>@])],
+  [AS_HELP_STRING([--with-modules], [which backends to compile with @<:@default=bind gmysql@:>@])],
   [modules="$withval"]
 )
 
@@ -350,7 +350,6 @@ AC_CONFIG_FILES([
   modules/lmdbbackend/Makefile
   modules/lua2backend/Makefile
   modules/pipebackend/Makefile
-  modules/randombackend/Makefile
   modules/remotebackend/Makefile
   modules/tinydnsbackend/Makefile
 ])
index 79bd11fba7933cc779b8105330e6df142e8cb5f4..6659a3124e6ad87fb16e4d95d90dfc84f8a01c7d 100644 (file)
@@ -263,10 +263,6 @@ The third part registers the RandomFactory with PowerDNS. This is a
 simple C++ trick which makes sure that this function is called on
 execution of the binary or when loading the dynamic module.
 
-Please note that a RandomBackend is actually in most PowerDNS releases.
-By default it lives on random.example.com, but you can change that by
-setting :ref:`setting-random-hostname`.
-
 .. note::
   This simple backend neglects to handle case properly!
 
index 6f7af49907a68c04346a3136b55f0637eecc229a..1fe945a61f5bf5b4ef2ba36ed0d843d15d9f9988 100644 (file)
@@ -1,6 +1,9 @@
 Random Backend
 ==============
 
+.. deprecated:: 4.6.0
+  This backend has been removed in 4.6.0
+
 - Native: Yes
 - Master: No
 - Slave: No
index bc4782ccadb11106aac2176951eea2dfa4098bca..1c51fb643885498a4d5761894fab31adc4e4ce26 100644 (file)
@@ -11,6 +11,5 @@ DIST_SUBDIRS = \
        lmdbbackend \
        lua2backend \
        pipebackend \
-       randombackend \
        remotebackend \
        tinydnsbackend
diff --git a/modules/randombackend/Makefile.am b/modules/randombackend/Makefile.am
deleted file mode 100644 (file)
index 2da4bbd..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-pkglib_LTLIBRARIES = librandombackend.la
-
-EXTRA_DIST = OBJECTFILES OBJECTLIBS
-
-librandombackend_la_SOURCES = randombackend.cc
-librandombackend_la_LDFLAGS = -module -avoid-version
diff --git a/modules/randombackend/OBJECTFILES b/modules/randombackend/OBJECTFILES
deleted file mode 100644 (file)
index 012f607..0000000
+++ /dev/null
@@ -1 +0,0 @@
-randombackend.lo
diff --git a/modules/randombackend/OBJECTLIBS b/modules/randombackend/OBJECTLIBS
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/modules/randombackend/randombackend.cc b/modules/randombackend/randombackend.cc
deleted file mode 100644 (file)
index 01839e9..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * This file is part of PowerDNS or dnsdist.
- * Copyright -- PowerDNS.COM B.V. and its contributors
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * In addition, for the avoidance of any doubt, permission is granted to
- * link this program with OpenSSL and to (re)distribute the binaries
- * produced as the result of such linking.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include "pdns/dnsbackend.hh"
-#include "pdns/dns.hh"
-#include "pdns/dnsbackend.hh"
-#include "pdns/dnspacket.hh"
-#include "pdns/dns_random.hh"
-#include "pdns/pdnsexception.hh"
-#include "pdns/logger.hh"
-#include "pdns/version.hh"
-#include <boost/algorithm/string.hpp>
-
-/* FIRST PART */
-class RandomBackend : public DNSBackend
-{
-public:
-  RandomBackend(const string& suffix = "")
-  {
-    setArgPrefix("random" + suffix);
-    d_ourname = DNSName(getArg("hostname"));
-    d_ourdomain = d_ourname;
-    d_ourdomain.chopOff();
-  }
-
-  bool list(const DNSName& target, int id, bool include_disabled) override
-  {
-    return false; // we don't support AXFR
-  }
-
-  void lookup(const QType& type, const DNSName& qdomain, int zoneId, DNSPacket* p) override
-  {
-    if (qdomain == d_ourdomain) {
-      if (type.getCode() == QType::SOA || type.getCode() == QType::ANY) {
-        d_answer = "ns1." + d_ourdomain.toString() + " hostmaster." + d_ourdomain.toString() + " 1234567890 86400 7200 604800 300";
-      }
-      else {
-        d_answer.clear();
-        ;
-      }
-    }
-    else if (qdomain == d_ourname) {
-      if (type.getCode() == QType::A || type.getCode() == QType::ANY) {
-        ostringstream os;
-        os << dns_random(256) << "." << dns_random(256) << "." << dns_random(256) << "." << dns_random(256);
-        d_answer = os.str(); // our random ip address
-      }
-      else {
-        d_answer = "";
-      }
-    }
-    else {
-      d_answer = "";
-    }
-  }
-
-  bool get(DNSResourceRecord& rr) override
-  {
-    if (d_answer.empty())
-      return false;
-
-    if (d_answer.find("ns1.") == 0) {
-      rr.qname = d_ourdomain;
-      rr.qtype = QType::SOA;
-    }
-    else {
-      rr.qname = d_ourname;
-      rr.qtype = QType::A;
-    }
-    rr.qclass = QClass::IN; // Internet class randomness.
-    rr.ttl = 5; // 5 seconds
-    rr.auth = true; // it may be random.. but it is auth!
-    rr.content = d_answer;
-
-    d_answer.clear(); // this was the last answer
-    return true;
-  }
-
-private:
-  string d_answer;
-  DNSName d_ourname;
-  DNSName d_ourdomain;
-};
-
-/* SECOND PART */
-
-class RandomFactory : public BackendFactory
-{
-public:
-  RandomFactory() :
-    BackendFactory("random") {}
-  void declareArguments(const string& suffix = "") override
-  {
-    declare(suffix, "hostname", "Hostname which is to be random", "random.example.com");
-  }
-  DNSBackend* make(const string& suffix = "") override
-  {
-    return new RandomBackend(suffix);
-  }
-};
-
-/* THIRD PART */
-
-class RandomLoader
-{
-public:
-  RandomLoader()
-  {
-    BackendMakers().report(new RandomFactory);
-    g_log << Logger::Info << "[randombackend] This is the random backend version " VERSION
-#ifndef REPRODUCIBLE
-          << " (" __DATE__ " " __TIME__ ")"
-#endif
-          << " reporting" << endl;
-  }
-};
-
-static RandomLoader randomLoader;
index 7f77e457fe3f189befe30e94c6f7336fd6cbc760..a11822a2fbd82e9655a288a703948e6f44170f10 100755 (executable)
@@ -9,31 +9,31 @@ port=5600
 rm -f pdns*.pid
 
 $PDNS --daemon=no --local-address=127.0.0.1,::1 \
-  --local-port=$port --socket-dir=./ --no-shuffle --launch=random --no-config \
-  --module-dir=../regression-tests/modules --zone-cache-refresh-interval=0 &
+  --local-port=$port --socket-dir=./ --no-shuffle --launch=bind --no-config \
+  --module-dir=../regression-tests/modules --bind-config=counters/named.conf &
 
 sleep 2
 
-$SDIG 127.0.0.1 $port random.example.com A >&2 >/dev/null
-$SDIG 127.0.0.1 $port example.com SOA >&2 >/dev/null
+$SDIG 127.0.0.1 $port server1.test.com A >&2 >/dev/null
+$SDIG 127.0.0.1 $port test.com SOA >&2 >/dev/null
 
-$SDIG 127.0.0.1 $port random.example.com A tcp >&2 >/dev/null
-$SDIG 127.0.0.1 $port example.com SOA tcp >&2 >/dev/null
+$SDIG 127.0.0.1 $port server1.test.com A tcp >&2 >/dev/null
+$SDIG 127.0.0.1 $port test.com SOA tcp >&2 >/dev/null
 
-$SDIG ::1 $port random.example.com A >&2 >/dev/null
-$SDIG ::1 $port random.example.com A tcp >&2 >/dev/null
+$SDIG ::1 $port server1.test.com A >&2 >/dev/null
+$SDIG ::1 $port server1.com A tcp >&2 >/dev/null
 
-$SDIG ::1 $port example.com SOA >&2 >/dev/null
-$SDIG ::1 $port example.com SOA tcp >&2 >/dev/null
+$SDIG ::1 $port test.com SOA >&2 >/dev/null
+$SDIG ::1 $port test.com SOA tcp >&2 >/dev/null
 
 # NXDOMAIN
-$SDIG 127.0.0.1 $port nx.example.com A >&2 >/dev/null
+$SDIG 127.0.0.1 $port nx.test.com A >&2 >/dev/null
 
 # NOERROR
-$SDIG 127.0.0.1 $port example.com SRV >&2 >/dev/null
+$SDIG 127.0.0.1 $port test.com SRV >&2 >/dev/null
 
 # unauth
-$SDIG 127.0.0.1 $port example.invalid MX >&2 >/dev/null
+$SDIG 127.0.0.1 $port test.com.invalid MX >&2 >/dev/null
 
 $PDNSCONTROL --config-name= --no-config --socket-dir=./ 'show *' | \
   tr ',' '\n'| grep -v -E '(user-msec|sys-msec|cpu-iowait|cpu-steal|uptime|udp-noport-errors|udp-in-errors|real-memory-usage|special-memory-usage|udp-recvbuf-errors|udp-sndbuf-errors|-hit|-miss|fd-usage|latency|backend-queries)' | LC_ALL=C sort
index 6ae3c5e88ac16b73560a37a1fece00ff237911b5..452465d2906ccf1bffeb1e34d17cd9d2d4bb0f9f 100644 (file)
@@ -15,9 +15,9 @@ noerror-packets=1
 nxdomain-packets=1
 open-tcp-connections=0
 overload-drops=0
-packetcache-size=7
+packetcache-size=8
 qsize-q=0
-query-cache-size=10
+query-cache-size=4
 rd-queries=0
 recursing-answers=0
 recursing-questions=0
@@ -44,26 +44,26 @@ security-status=0
 servfail-packets=0
 signature-cache-size=0
 signatures=0
-tcp-answers-bytes=264
+tcp-answers-bytes=235
 tcp-answers=4
 tcp-queries=4
-tcp4-answers-bytes=132
+tcp4-answers-bytes=128
 tcp4-answers=2
 tcp4-queries=2
-tcp6-answers-bytes=132
+tcp6-answers-bytes=107
 tcp6-answers=2
 tcp6-queries=2
 timedout-packets=0
-udp-answers-bytes=460
+udp-answers-bytes=449
 udp-answers=7
 udp-do-queries=0
 udp-queries=7
-udp4-answers-bytes=328
+udp4-answers-bytes=321
 udp4-answers=5
 udp4-queries=5
-udp6-answers-bytes=132
+udp6-answers-bytes=128
 udp6-answers=2
 udp6-queries=2
-unauth-packets=1
+unauth-packets=2
 xfr-queue=0
-zone-cache-size=0
+zone-cache-size=1
diff --git a/regression-tests.nobackend/counters/named.conf b/regression-tests.nobackend/counters/named.conf
new file mode 100644 (file)
index 0000000..110e915
--- /dev/null
@@ -0,0 +1,14 @@
+options {
+       directory "../regression-tests/zones/";
+       recursion no;
+       listen-on port 5300 {
+               127.0.0.1;
+       };
+       version "Meow!Meow!";
+       minimal-responses yes;
+};
+
+zone "test.com"{
+       type master;
+       file "./test.com";
+};
index 3db92b8b18d0153693b16262fc75db1a4dd9aa0a..aafa977514e3086d64f492568668c24bdd4186c2 100644 (file)
--- a/tasks.py
+++ b/tasks.py
@@ -208,7 +208,7 @@ def ci_auth_configure(c):
                       CC='clang-11' \
                       CXX='clang++-11' \
                       --enable-option-checking=fatal \
-                      --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe random remote tinydns' \
+                      --with-modules='bind geoip gmysql godbc gpgsql gsqlite3 ldap lmdb lua2 pipe remote tinydns' \
                       --enable-systemd \
                       --enable-tools \
                       --enable-unit-tests \