1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-28 02:50:16 +03:00

resolve: clear previous assignments of RefuseRecordTypes= on reload

Follow-up for 81ae2237c1792943a1ec712ae2e630bcc592175b.
This commit is contained in:
Muhammad Nuzaihan Bin Kamal Luddin 2025-02-12 13:40:04 +08:00 committed by Luca Boccassi
parent 225dbd6108
commit e644b332d0
2 changed files with 25 additions and 0 deletions

View File

@ -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) {

View File

@ -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