summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--resolv/nss_dns/dns-host.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c4183089f7..f178cc0398 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
 2000-07-09  Mark Kettenis  <kettenis@gnu.org>
 
 	* elf/rtld.c (dl_main): Move call to __libc_check_standard_fds...
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c
index e99d964203..f7b1007f29 100644
--- a/resolv/nss_dns/dns-host.c
+++ b/resolv/nss_dns/dns-host.c
@@ -131,6 +131,7 @@ _nss_dns_gethostbyname2_r (const char *name, int af, struct hostent *result,
 			   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 *name, int af, struct hostent *result,
    * 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,