diff options
author | Florian Weimer <fweimer@redhat.com> | 2019-04-11 11:37:47 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2019-04-11 11:37:47 +0200 |
commit | e3f454bac0f968216699ca405c127c858f0657c7 (patch) | |
tree | 9239772773f3b761aa4bdf09585bd9fccbff4c57 /resolv | |
parent | 32d85c116dd07b25f58b24204e7b05489f06fed4 (diff) | |
download | glibc-e3f454bac0f968216699ca405c127c858f0657c7.tar.gz glibc-e3f454bac0f968216699ca405c127c858f0657c7.tar.xz glibc-e3f454bac0f968216699ca405c127c858f0657c7.zip |
nss_dns: Do not replace root domain with empty string
The purpose of the bp[0] == '.' check is unclear. Only the root domain starts with '.'. The empty string is accepted as a domain name in many places, denoting the root, but using it implicitly is confusing.
Diffstat (limited to 'resolv')
-rw-r--r-- | resolv/nss_dns/dns-host.c | 3 | ||||
-rw-r--r-- | resolv/nss_dns/dns-network.c | 3 |
2 files changed, 0 insertions, 6 deletions
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c index a18b8a6bf4..9c15f25f28 100644 --- a/resolv/nss_dns/dns-host.c +++ b/resolv/nss_dns/dns-host.c @@ -706,9 +706,6 @@ getanswer_r (struct resolv_context *ctx, n = -1; } - if (n > 0 && bp[0] == '.') - bp[0] = '\0'; - if (__glibc_unlikely (n < 0)) { *errnop = errno; diff --git a/resolv/nss_dns/dns-network.c b/resolv/nss_dns/dns-network.c index 4b81b1bfdc..21688c19b2 100644 --- a/resolv/nss_dns/dns-network.c +++ b/resolv/nss_dns/dns-network.c @@ -345,9 +345,6 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result, n = -1; } - if (n > 0 && bp[0] == '.') - bp[0] = '\0'; - if (n < 0 || res_dnok (bp) == 0) break; cp += n; |