From: Muhammad Nuzaihan Bin Kamal Luddin Date: Wed, 12 Feb 2025 05:40:04 +0000 (+0800) Subject: resolve: clear previous assignments of RefuseRecordTypes= on reload X-Git-Tag: v258-rc1~1338^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e644b332d0ce1fc8f3763121693a83e8c6fe483f;p=thirdparty%2Fsystemd.git resolve: clear previous assignments of RefuseRecordTypes= on reload Follow-up for 81ae2237c1792943a1ec712ae2e630bcc592175b. --- diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index f86cc4267d2..a1588114471 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -631,6 +631,7 @@ static void manager_set_defaults(Manager *m) { m->resolve_unicast_single_label = false; m->cache_from_localhost = false; m->stale_retention_usec = 0; + m->refuse_record_types = set_free(m->refuse_record_types); } static int manager_dispatch_reload_signal(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata) { diff --git a/test/units/TEST-75-RESOLVED.sh b/test/units/TEST-75-RESOLVED.sh index facc39b47de..d7b535f1538 100755 --- a/test/units/TEST-75-RESOLVED.sh +++ b/test/units/TEST-75-RESOLVED.sh @@ -1135,6 +1135,30 @@ testcase_14_refuse_record_types() { run resolvectl query localhost5 --type=A grep -qF "127.128.0.5" "$RUN_OUT" + + { + echo "[Resolve]" + echo "RefuseRecordTypes=AAAA" + } >/run/systemd/resolved.conf.d/refuserecords.conf + systemctl reload systemd-resolved.service + + run dig localhost -t SRV + grep -qF "status: NOERROR" "$RUN_OUT" + + run dig localhost -t TXT + grep -qF "status: NOERROR" "$RUN_OUT" + + run dig localhost -t AAAA + grep -qF "status: REFUSED" "$RUN_OUT" + + (! run resolvectl query localhost5 --type=SRV) + grep -qF "does not have any RR of the requested type" "$RUN_OUT" + + (! run resolvectl query localhost5 --type=TXT) + grep -qF "does not have any RR of the requested type" "$RUN_OUT" + + (! run resolvectl query localhost5 --type=AAAA) + grep -qF "DNS query type refused." "$RUN_OUT" } # PRE-SETUP