Resolver related thread-safety fix
Mark Kettenis
kettenis@wins.uva.nl
Mon Jul 10 06:22:00 GMT 2000
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,
More information about the Libc-hacker
mailing list