From: Miod Vallat Date: Mon, 15 Dec 2025 07:33:40 +0000 (+0100) Subject: Allow (but warn) entropy-source and rng settings until 5.2. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc50eabf1833efd0f299350b55f79f00a3a43b95;p=thirdparty%2Fpdns.git Allow (but warn) entropy-source and rng settings until 5.2. Signed-off-by: Miod Vallat --- diff --git a/pdns/auth-main.cc b/pdns/auth-main.cc index a264e41399..44b3c5208c 100644 --- a/pdns/auth-main.cc +++ b/pdns/auth-main.cc @@ -344,6 +344,10 @@ static void declareArguments() ::arg().setSwitch("views", "Enable views (variants) of zones, for backends which support them") = "no"; + // FIXME520: remove when branching 5.2 + ::arg().set("entropy-source", "") = ""; + ::arg().set("rng", "") = ""; + ::arg().setDefaults(); } @@ -1296,6 +1300,17 @@ int main(int argc, char** argv) ::arg().laxFile(configname.c_str()); ::arg().laxParse(argc, argv); // reparse so the commandline still wins + + // FIXME520: remove when branching 5.2 + if (!::arg()["entropy-source"].empty()) { + std::cerr << "WARNING: `entropy-source' setting is deprecated" << std::endl + << "and will be removed in a future version" << std::endl; + } + if (!::arg()["rng"].empty()) { + std::cerr << "WARNING: `rng' setting is deprecated" << std::endl + << "and will be removed in a future version" << std::endl; + } + if (!::arg()["logging-facility"].empty()) { int val = logFacilityToLOG(::arg().asNum("logging-facility")); if (val >= 0) diff --git a/pdns/dnsbulktest.cc b/pdns/dnsbulktest.cc index 2ee0c3db1d..6f28f94a26 100644 --- a/pdns/dnsbulktest.cc +++ b/pdns/dnsbulktest.cc @@ -50,12 +50,6 @@ po::variables_map g_vm; StatBag S; -ArgvMap &arg() -{ - static ArgvMap theArg; - return theArg; -} - bool g_quiet=false; bool g_envoutput=false; diff --git a/pdns/notify.cc b/pdns/notify.cc index bde994a4bd..1765b9c1ac 100644 --- a/pdns/notify.cc +++ b/pdns/notify.cc @@ -45,11 +45,6 @@ namespace po = boost::program_options; po::variables_map g_vm; StatBag S; -ArgvMap &arg() -{ - static ArgvMap arg; - return arg; -} static void usage() { cerr<<"Syntax: pdns_notify IP_ADDRESS/HOSTNAME[:PORT] DOMAIN"<& vec) static void loadMainConfig(const std::string& configdir) { + // FIXME520: remove when branching 5.2 + ::arg().set("entropy-source", "") = ""; + ::arg().set("rng", "") = ""; + ::arg().set("config-dir","Location of configuration directory (pdns.conf)")=configdir; ::arg().set("default-ttl","Seconds a result is valid if not set otherwise")="3600"; ::arg().set("launch","Which backends to launch"); @@ -648,6 +652,16 @@ static void loadMainConfig(const std::string& configdir) ::arg().setSwitch("views", "Enable views (variants) of zones, for backends which support them") = "no"; ::arg().laxFile(configname); + // FIXME520: remove when branching 5.2 + if (!::arg()["entropy-source"].empty()) { + std::cerr << "WARNING: `entropy-source' setting is deprecated" << std::endl + << "and will be removed in a future version" << std::endl; + } + if (!::arg()["rng"].empty()) { + std::cerr << "WARNING: `rng' setting is deprecated" << std::endl + << "and will be removed in a future version" << std::endl; + } + if(!::arg()["load-modules"].empty()) { vector modules; @@ -677,7 +691,6 @@ static void loadMainConfig(const std::string& configdir) ::arg().set("zone-metadata-cache-ttl", "Seconds to cache zone metadata from the database") = "60"; ::arg().set("consistent-backends", "Assume individual zones are not divided over backends. Send only ANY lookup operations to the backend to reduce the number of lookups") = "yes"; - // Keep this line below all ::arg().set() statements if (! ::arg().laxFile(configname)) { cerr<<"Warning: unable to read configuration file '"<