More on nscd problem
Ulrich Drepper
drepper@cygnus.com
Thu Apr 1 00:00:00 GMT 1999
"Martin v. Loewis" <martin@mira.isdn.cs.tu-berlin.de> writes:
> will return NSS_STATUS_TRYAGAIN. errno at that time is 90, which
> translates to EMSGSIZE on my system. gethostbyname will consider the
> operation failed, and set *result to NULL.
The only place I could think has a problem is the one corrected in the
patch below. Please give it a try at tell me ASAP.
--
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: dns-host.c
===================================================================
RCS file: /glibc/cvsfiles/libc/resolv/nss_dns/dns-host.c,v
retrieving revision 1.13
diff -d -u -p -r1.13 dns-host.c
--- dns-host.c 1998/10/18 14:51:05 1.13
+++ dns-host.c 1999/02/03 01:28:28
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Extended from original form by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -606,7 +606,13 @@ getanswer_r (const querybuf *answer, int
if (result->h_name == NULL)
{
n = strlen (qname) + 1; /* For the \0. */
- if (n > linebuflen || n >= MAXHOSTNAMELEN)
+ if (n > linebuflen)
+ {
+ *errnop = ERANGE;
+ *h_errnop = NETDB_INTERNAL;
+ return NSS_STATUS_TRYAGAIN;
+ }
+ if (n >= MAXHOSTNAMELEN)
goto no_recovery;
result->h_name = strcpy (bp, qname); /* Cannot overflow. */
bp += n;
More information about the Libc-alpha
mailing list