1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

resolv: Lift domain search list limits [BZ #19569] [BZ #21475]

This change uses the extended resolver state in struct resolv_conf to
store the search list.  If applications have not patched the _res
object directly, this extended search list will be used by the stub
resolver during name resolution.
This commit is contained in:
Florian Weimer
2017-07-01 00:53:05 +02:00
parent f30a54b21b
commit 3f853f22c8
8 changed files with 382 additions and 81 deletions

View File

@ -326,7 +326,7 @@ __res_context_search (struct resolv_context *ctx,
int *nanswerp2, int *resplen2, int *answerp2_malloced)
{
struct __res_state *statp = ctx->resp;
const char *cp, * const *domain;
const char *cp;
HEADER *hp = (HEADER *) answer;
char tmp[NS_MAXDNAME];
u_int dots;
@ -392,10 +392,11 @@ __res_context_search (struct resolv_context *ctx,
(dots && !trailing_dot && (statp->options & RES_DNSRCH) != 0)) {
int done = 0;
for (domain = (const char * const *)statp->dnsrch;
*domain && !done;
domain++) {
const char *dname = domain[0];
for (size_t domain_index = 0; !done; ++domain_index) {
const char *dname = __resolv_context_search_list
(ctx, domain_index);
if (dname == NULL)
break;
searched = 1;
/* __res_context_querydoman concatenates name