This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Resolver related thread-safety fix


When converting the DNS NSS module to use the new thread-safe resolver
functions, Andreas overlooked __hostalias.  This patch corrects this.

Mark


2000-07-10  Mark Kettenis  <kettenis@gnu.org>

	* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r): Use
	res_hostalias instead of __hostalias for thread-safety.


Index: resolv/nss_dns/dns-host.c
===================================================================
RCS file: /cvs/glibc/libc/resolv/nss_dns/dns-host.c,v
retrieving revision 1.23
diff -u -p -r1.23 dns-host.c
--- resolv/nss_dns/dns-host.c	2000/05/27 08:16:24	1.23
+++ resolv/nss_dns/dns-host.c	2000/07/10 13:17:12
@@ -131,6 +131,7 @@ _nss_dns_gethostbyname2_r (const char *n
 			   int *h_errnop)
 {
   querybuf host_buffer;
+  char tmp[NS_MAXDNAME];
   int size, type, n;
   const char *cp;
   int map = 0;
@@ -161,7 +162,8 @@ _nss_dns_gethostbyname2_r (const char *n
    * this is also done in res_query() since we are not the only
    * function that looks up host names.
    */
-  if (strchr (name, '.') == NULL && (cp = __hostalias (name)) != NULL)
+  if (strchr (name, '.') == NULL
+      && (cp = res_hostalias (&_res, name, tmp, sizeof (tmp))) != NULL)
     name = cp;
 
   n = res_nsearch (&_res, name, C_IN, type, host_buffer.buf,

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]