about summary refs log tree commit diff
path: root/nss
diff options
context:
space:
mode:
Diffstat (limited to 'nss')
-rw-r--r--nss/getXXbyYY_r.c12
-rw-r--r--nss/getXXent_r.c14
2 files changed, 25 insertions, 1 deletions
diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c
index d20fa34498..a4dc0011a2 100644
--- a/nss/getXXbyYY_r.c
+++ b/nss/getXXbyYY_r.c
@@ -152,6 +152,18 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
       status = (*fct) (ADD_VARIABLES, resbuf, buffer, buflen,
 		       __errno_location () H_ERRNO_VAR);
 
+      /* The the status is NSS_STATUS_TRYAGAIN and errno is ERANGE the
+	 provided buffer is too small.  In this case we should give
+	 the user the possibility to enlarge the buffer and we should
+	 not simply go on with the next service (even if the TRYAGAIN
+	 action tells us so).  */
+      if (status == NSS_STATUS_TRYAGAIN
+#ifdef NEED_H_ERRNO
+	  && *h_errnop == NETDB_INTERNAL
+#endif
+	  && errno == ERANGE)
+	break;
+
       no_more = __nss_next (&nip, REENTRANT_NAME_STRING,
 			    (void **) &fct, status, 0);
     }
diff --git a/nss/getXXent_r.c b/nss/getXXent_r.c
index 1884b0773d..aa21b6fe7c 100644
--- a/nss/getXXent_r.c
+++ b/nss/getXXent_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -249,6 +249,18 @@ INTERNAL (REENTRANT_GETNAME) (LOOKUP_TYPE *resbuf, char *buffer, size_t buflen,
       status = (*fct) (resbuf, buffer, buflen, __errno_location ()
 		       H_ERRNO_VAR);
 
+      /* The the status is NSS_STATUS_TRYAGAIN and errno is ERANGE the
+	 provided buffer is too small.  In this case we should give
+	 the user the possibility to enlarge the buffer and we should
+	 not simply go on with the next service (even if the TRYAGAIN
+	 action tells us so).  */
+      if (status == NSS_STATUS_TRYAGAIN
+#ifdef NEED_H_ERRNO
+	  && *h_errnop == NETDB_INTERNAL
+#endif
+	  && errno == ERANGE)
+	break;
+
       no_more = __nss_next (&nip, GETFUNC_NAME_STRING, (void **) &fct,
 			    status, 0);