]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
do not log "no root hints for view '_bind'"
authorColin Vidal <colin@isc.org>
Fri, 21 Nov 2025 14:07:54 +0000 (15:07 +0100)
committerEvan Hunt <each@isc.org>
Fri, 21 Nov 2025 22:21:44 +0000 (14:21 -0800)
The "no root hints for view X" message must not be shown for the default
_bind/CH view. However, it is shown since 27c4f68dcc1 (part of effective
configuration changes).

The reason is that since 27c4f68dcc1, `configure_views()` now processes
a single list of views, which contains both builtin and user views as
they are both part of the effective configuration. Those changes omitted
the `need_hints` bool that disabled the warning for the builtin view.
This commit silences the log message again.

bin/named/server.c
bin/tests/system/nohintswarn-bindchaos/ns1/named.conf.j2 [new file with mode: 0644]
bin/tests/system/nohintswarn-bindchaos/tests_nohintswarn_bindchaos.py [new file with mode: 0644]

index f7955a421a2635d02f33496795a2f738f38a5021..8cbc1087f6d397c2f35371151cc91d1c25306db7 100644 (file)
@@ -4652,7 +4652,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
                                        &rootzone);
                if (rootzone != NULL) {
                        dns_zone_detach(&rootzone);
-               } else {
+               } else if (strcmp(view->name, "_bind") != 0 ||
+                          view->rdclass != dns_rdataclass_chaos)
+               {
                        isc_log_write(NAMED_LOGCATEGORY_GENERAL,
                                      NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
                                      "no root hints for view '%s'",
diff --git a/bin/tests/system/nohintswarn-bindchaos/ns1/named.conf.j2 b/bin/tests/system/nohintswarn-bindchaos/ns1/named.conf.j2
new file mode 100644 (file)
index 0000000..a6728e1
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0.  If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+options {
+        port @PORT@;
+        pid-file "named.pid";
+        listen-on { 10.53.0.1; };
+};
+
+key rndc_key {
+        secret "1234abcd8765";
+        algorithm @DEFAULT_HMAC@;
+};
+
+controls {
+        inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
+};
+
+view _bind {
+};
+
+view foo {
+};
+
+view bar ch {
+};
diff --git a/bin/tests/system/nohintswarn-bindchaos/tests_nohintswarn_bindchaos.py b/bin/tests/system/nohintswarn-bindchaos/tests_nohintswarn_bindchaos.py
new file mode 100644 (file)
index 0000000..bb788d1
--- /dev/null
@@ -0,0 +1,25 @@
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# SPDX-License-Identifier: MPL-2.0
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0.  If a copy of the MPL was not distributed with this
+# file, you can obtain one at https://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+import isctest
+
+
+def test_nohintswarn_bindchaos(ns1):
+    found = True
+    try:
+        with ns1.watch_log_from_start(timeout=1) as watcher:
+            watcher.wait_for_line("no root hints for view '_bind'")
+    except isctest.log.watchlog.WatchLogTimeout:
+        found = False
+    assert found is False
+
+    with ns1.watch_log_from_start() as watcher:
+        watcher.wait_for_line("no root hints for view 'bar'")