]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: disable parsing of old-style settings by default
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 28 Oct 2024 16:02:07 +0000 (17:02 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 4 Nov 2024 11:44:36 +0000 (12:44 +0100)
pdns/recursordist/rec-main.cc
pdns/recursordist/settings/table.py
regression-tests.recursor-dnssec/recursortests.py
regression-tests.recursor/vars.sample
regression-tests/recursor-test

index 55564926b6370a7ec98912b57d70a7850c16a314..1a06447ee3f0af4553c1047e0fe1c801eca6ab6d 100644 (file)
@@ -3223,6 +3223,12 @@ int main(int argc, char** argv)
         SLOG(g_log << Logger::Warning << "Unable to open configuration file '" << configname << "'" << endl,
              startupLog->error("No such file", "Unable to open configuration file", "config_file", Logging::Loggable(configname)));
       }
+      else {
+        if (!::arg().mustDo("enable-old-settings")) {
+          startupLog->info(Logr::Error, "Old-style settings syntax not enabled by default anymore. Use YAML or enable with --enable-old-settings on the command line", "configname", Logging::Loggable(configname));
+          return EXIT_FAILURE;
+        }
+      }
     }
 
     // Reparse, now with config file as well, both for old-style as for YAML settings
index 8f0733ac477ae5d85ed7bd77b2f3399b0289ccc9..c7ff798d4a2f6df08bf92c1edbffc6837bbc1035 100644 (file)
@@ -939,6 +939,19 @@ By default, this option is empty, meaning no EDNS Client Subnet information is s
  ''',
     'versionadded': '4.5.0'
     },
+    {
+        'name' : 'enable_old_settings',
+        'section' : 'recursor',
+        'type' : LType.Bool,
+        'default' : 'false',
+        'help' : 'Enable (deprecated) parsing of old-style settings',
+        'doc' : '''
+Enable the deprecated parsing of old-style settings.
+Only makes sense to set on the command line.
+        ''',
+        'skip-yaml': True,
+        'versionadded': '5.2.0',
+    },
     {
         'name' : 'entropy_source',
         'section' : 'recursor',
index bb97883624fce73549da1d5123ef57f7899d6343..284b9425529143bb4a6577afff26c7283186b8f2 100644 (file)
@@ -699,7 +699,8 @@ distributor-threads={threads}""".format(confdir=confdir,
         recursorcmd = [os.environ['PDNSRECURSOR'],
                        '--config-dir=%s' % confdir,
                        '--local-port=%s' % port,
-                       '--security-poll-suffix=']
+                       '--security-poll-suffix=',
+                       '--enable-old-settings']
         print(' '.join(recursorcmd))
 
         logFile = os.path.join(confdir, 'recursor.log')
index 2d257233189d3d622b9730265e22bcd738c0ac22..9c5756210b12b2be170a752228df301937be558c 100644 (file)
@@ -1,5 +1,5 @@
 PREFIX=10.0.3
 # PDNSRECURSOR=    # set to override default location
-# PDNS=            # set to override default location   
+# PDNS=            # set to override default location
 AUTHRUN="exec authbind ${PDNS} --config-dir=. > logfile 2>&1"
-RECRUN="exec authbind ${PDNSRECURSOR} --config-dir=. --daemon=no --trace=yes --dont-query= --local-address=$PREFIX.9 --hint-file=hintfile --packetcache-ttl=0 --max-cache-ttl=15 --threads=1 > logfile 2>&1"
+RECRUN="exec authbind ${PDNSRECURSOR} --config-dir=. --daemon=no --trace=yes --dont-query= --local-address=$PREFIX.9 --hint-file=hintfile --packetcache-ttl=0 --max-cache-ttl=15 --threads=1 --enable-old-settings > logfile 2>&1"
index ec58cfe90b40dfe1da5da2313997eeaa72dcdf8b..2a6a704b7f3cce90522255addb504bd53246095b 100755 (executable)
@@ -31,7 +31,7 @@ rm -f recursor.pid pdns_recursor.pid
 <measurement><name>system CPU seconds</name><value>%S</value></measurement>
 <measurement><name>wallclock seconds</name><value>%e</value></measurement>
 <measurement><name>%% CPU used</name><value>%P</value></measurement>
-'         ${RECURSOR} --daemon=no --local-port=$port --socket-dir=./ --trace=$TRACE --config-dir=. --max-mthreads=$mthreads --query-local-address="0.0.0.0${QLA6}" --threads=$threads --record-cache-shards=$shards --refresh-on-ttl-perc=10 --dnssec=validate --pdns-distributes-queries --reuseport=no > recursor.log 2>&1 &
+'         ${RECURSOR} --daemon=no --local-port=$port --socket-dir=./ --trace=$TRACE --config-dir=. --max-mthreads=$mthreads --query-local-address="0.0.0.0${QLA6}" --threads=$threads --record-cache-shards=$shards --refresh-on-ttl-perc=10 --dnssec=validate --pdns-distributes-queries --reuseport=no --enable-old-settings > recursor.log 2>&1 &
 sleep 3
 if [ ! -e pdns_recursor.pid ]; then
         cat recursor.log