about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-08-09 00:51:39 +0000
committerUlrich Drepper <drepper@redhat.com>2004-08-09 00:51:39 +0000
commit78512c00a8e0e07a8e4aa63b0f0e26b2e49de832 (patch)
treed67033256da4950e6c17497ac7495394299a53fb
parent020a9a23e2eff7479ccdc6a9fc11c7572925baae (diff)
downloadglibc-78512c00a8e0e07a8e4aa63b0f0e26b2e49de832.tar.gz
glibc-78512c00a8e0e07a8e4aa63b0f0e26b2e49de832.tar.xz
glibc-78512c00a8e0e07a8e4aa63b0f0e26b2e49de832.zip
[BZ #95]
Update.
	* resolv/res_query.c (__libc_res_nsearch): Correctly test whether
	name contains any dots. [BZ #95]
-rw-r--r--ChangeLog3
-rw-r--r--resolv/res_query.c14
2 files changed, 14 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 08f8e1a6a8..3fb1d23ef2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-08-08  Ulrich Drepper  <drepper@redhat.com>
 
+	* resolv/res_query.c (__libc_res_nsearch): Correctly test whether
+	name contains any dots. [BZ #95]
+
 	* resolv/res_send.c: Compiling with DEBUG defined works again.
 	* resolv/gethnamaddr.c (dprintf): Renamed to Dprintf.  Adjust all
 	callers.
diff --git a/resolv/res_query.c b/resolv/res_query.c
index ab4e02a559..f6d7f16dab 100644
--- a/resolv/res_query.c
+++ b/resolv/res_query.c
@@ -139,7 +139,7 @@ __libc_res_nquery(res_state statp,
 			use_malloc = 1;
 			n = res_nmkquery(statp, QUERY, name, class, type, NULL,
 					 0, NULL, buf, MAXPACKET);
-		}		
+		}
 	}
 	if (__builtin_expect (n <= 0, 0)) {
 #ifdef DEBUG
@@ -239,6 +239,9 @@ __libc_res_nsearch(res_state statp,
 		return (__libc_res_nquery(statp, cp, class, type, answer,
 					  anslen, answerp));
 
+	printf("dots=%d, statp->ndots=%d, trailing_dot=%d, name=%s\n",
+	       (int)dots,(int)statp->ndots,(int)trailing_dot,name);
+
 	/*
 	 * If there are enough dots in the name, let's just give it a
 	 * try 'as is'. The threshold can be set with the "ndots" option.
@@ -337,7 +340,7 @@ __libc_res_nsearch(res_state statp,
 	 * for the name, and "." is not on the search list, then try an as-is
 	 * query now.
 	 */
-	if (statp->ndots && !(tried_as_is || root_on_list)) {
+	if (dots && !(tried_as_is || root_on_list)) {
 		ret = __libc_res_nquerydomain(statp, name, NULL, class, type,
 					      answer, anslen, answerp);
 		if (ret > 0)
@@ -388,6 +391,8 @@ __libc_res_nquerydomain(res_state statp,
 	const char *longname = nbuf;
 	int n, d;
 
+	write(2,"<<aaaa\n",7);
+
 #ifdef DEBUG
 	if (statp->options & RES_DEBUG)
 		printf(";; res_nquerydomain(%s, %s, %d, %d)\n",
@@ -418,8 +423,11 @@ __libc_res_nquerydomain(res_state statp,
 		}
 		sprintf(nbuf, "%s.%s", name, domain);
 	}
-	return (__libc_res_nquery(statp, longname, class, type, answer,
+	int r = (__libc_res_nquery(statp, longname, class, type, answer,
 				  anslen, answerp));
+	write(2,">>aaaa\n",7);
+	return r;
+
 }
 
 int