From: Colin Vidal Date: Fri, 21 Nov 2025 14:07:54 +0000 (+0100) Subject: do not log "no root hints for view '_bind'" X-Git-Tag: v9.21.16~36^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68fda6a0358f857fec27a12a043d0cba4edc3f9b;p=thirdparty%2Fbind9.git do not log "no root hints for view '_bind'" 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. --- diff --git a/bin/named/server.c b/bin/named/server.c index f7955a421a2..8cbc1087f6d 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -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 index 00000000000..a6728e198c5 --- /dev/null +++ b/bin/tests/system/nohintswarn-bindchaos/ns1/named.conf.j2 @@ -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 index 00000000000..bb788d17087 --- /dev/null +++ b/bin/tests/system/nohintswarn-bindchaos/tests_nohintswarn_bindchaos.py @@ -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'")