diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-11-17 18:31:53 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-12-02 16:56:11 +0100 |
commit | 7e8a93b77c3c4d4df1e8c3177dc9553c94fac759 (patch) | |
tree | 0bf572bcf86dafe6267857274c2d5e8ec1af565a /src/resolve/resolved-link.c | |
parent | 9c2c6692f377e0540b6fcbdb73eac12775c6fad2 (diff) | |
download | systemd-7e8a93b77c3c4d4df1e8c3177dc9553c94fac759.tar.gz |
resolved: properly check per-link NTA list
We need to check for parent domains too. We did this correctly for the
system-wide NTA list, but not for the per-link one. Let's fix that.
Diffstat (limited to 'src/resolve/resolved-link.c')
-rw-r--r-- | src/resolve/resolved-link.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/resolve/resolved-link.c b/src/resolve/resolved-link.c index cb5be90c75..4fa4451ab7 100644 --- a/src/resolve/resolved-link.c +++ b/src/resolve/resolved-link.c @@ -1407,3 +1407,26 @@ void link_remove_user(Link *l) { (void) unlink(l->state_file); } + +bool link_negative_trust_anchor_lookup(Link *l, const char *name) { + int r; + + assert(l); + assert(name); + + /* Checks whether the specified domain (or any of its parent domains) are listed as per-link NTA. */ + + for (;;) { + if (set_contains(l->dnssec_negative_trust_anchors, name)) + return true; + + /* And now, let's look at the parent, and check that too */ + r = dns_name_parent(&name); + if (r < 0) + return r; + if (r == 0) + break; + } + + return false; +} |