mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
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.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2019-04-11 Florian Weimer <fweimer@redhat.com>
|
||||||
|
|
||||||
|
* resolv/nss_dns/dns-network.c (getanswer_r): Do not replace root
|
||||||
|
domain with empty string.
|
||||||
|
* resolv/nss_dns/dns-host.c (getanswer_r): Likewise.
|
||||||
|
|
||||||
2019-04-11 Florian Weimer <fweimer@redhat.com>
|
2019-04-11 Florian Weimer <fweimer@redhat.com>
|
||||||
|
|
||||||
* include/alloc_buffer.h (alloc_buffer_alloc_bytes): Update
|
* include/alloc_buffer.h (alloc_buffer_alloc_bytes): Update
|
||||||
|
@ -706,9 +706,6 @@ getanswer_r (struct resolv_context *ctx,
|
|||||||
n = -1;
|
n = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n > 0 && bp[0] == '.')
|
|
||||||
bp[0] = '\0';
|
|
||||||
|
|
||||||
if (__glibc_unlikely (n < 0))
|
if (__glibc_unlikely (n < 0))
|
||||||
{
|
{
|
||||||
*errnop = errno;
|
*errnop = errno;
|
||||||
|
@ -345,9 +345,6 @@ getanswer_r (const querybuf *answer, int anslen, struct netent *result,
|
|||||||
n = -1;
|
n = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n > 0 && bp[0] == '.')
|
|
||||||
bp[0] = '\0';
|
|
||||||
|
|
||||||
if (n < 0 || res_dnok (bp) == 0)
|
if (n < 0 || res_dnok (bp) == 0)
|
||||||
break;
|
break;
|
||||||
cp += n;
|
cp += n;
|
||||||
|
Reference in New Issue
Block a user