]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Allow (but warn) entropy-source and rng settings until 5.2. 16639/head
authorMiod Vallat <miod.vallat@powerdns.com>
Mon, 15 Dec 2025 07:33:40 +0000 (08:33 +0100)
committerMiod Vallat <miod.vallat@powerdns.com>
Mon, 15 Dec 2025 08:22:14 +0000 (09:22 +0100)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
pdns/auth-main.cc
pdns/dnsbulktest.cc
pdns/notify.cc
pdns/pdnsutil.cc
pdns/speedtest.cc

index a264e41399cd8e47d9d112996b37cd41045237ee..44b3c5208c5a5a3b4858371a0ef58d4e512534e7 100644 (file)
@@ -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)
index 2ee0c3db1d56547a79d4b6b4670b5df2d846e1ca..6f28f94a2631430202a078f14e5efc9213f484e4 100644 (file)
@@ -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;
 
index bde994a4bd2d5a0a8b28bdc1d272813350abd6c0..1765b9c1acf06bac53fd1d2db0f221e15010db26 100644 (file)
@@ -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"<<endl;
index 1e4c1b87a5a901f5e5ebb0dc20453e3cb706fd3d..ac4c9c3646c4c8ef0b666fdad8b6d52a6f9ee7e2 100644 (file)
@@ -607,6 +607,10 @@ static std::string comboAddressVecToString(const std::vector<ComboAddress>& 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<string> 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 '"<<configname<<"': "<<stringerror()<<endl;
index 6837f1dce7dc3c76f90b62e42b6ded9ec523d543..120f2e7a7550cb43d5f8decd49eaa56c0728d12f 100644 (file)
@@ -1378,9 +1378,3 @@ int main()
     cerr<<"Fatal: unexpected exception"<<endl;
   }
 }
-
-ArgvMap& arg()
-{      
-  static ArgvMap theArg;
-  return theArg;
-}