summary refs log tree commit diff
path: root/nss
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-08-10 00:16:35 +0000
committerUlrich Drepper <drepper@redhat.com>1998-08-10 00:16:35 +0000
commit0e94359046d83b56f1b15ff00c4b2f75499bf8c3 (patch)
treef9e5efe5b63fec49270a5c92e8607678dcb65b34 /nss
parentcdb47f096a5c5973f491ecbf12d26230e21221dc (diff)
downloadglibc-0e94359046d83b56f1b15ff00c4b2f75499bf8c3.tar.gz
glibc-0e94359046d83b56f1b15ff00c4b2f75499bf8c3.tar.xz
glibc-0e94359046d83b56f1b15ff00c4b2f75499bf8c3.zip
Update.
1998-08-10  Ulrich Drepper  <drepper@cygnus.com>

	* nss/nss_db/db-XXX.c (_nss_db_getXXX): If buffer is too small
	decrement `entidx' to allow retrieving the same entry again.
Diffstat (limited to 'nss')
-rw-r--r--nss/nss_db/db-XXX.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/nss/nss_db/db-XXX.c b/nss/nss_db/db-XXX.c
index 62c7a251f1..3839940028 100644
--- a/nss/nss_db/db-XXX.c
+++ b/nss/nss_db/db-XXX.c
@@ -282,6 +282,14 @@ CONCAT(_nss_db_get,ENTNAME_r) (struct STRUCTURE *result, char *buffer,
     {
       key.size = snprintf (key.data = buf, sizeof buf, "0%u", entidx++);
       status = lookup (&key, result, buffer, buflen, errnop H_ERRNO_ARG);
+      if (status == NSS_STATUS_TRYAGAIN
+#ifdef NEED_H_ERRNO
+	  && *herrnop == NETDB_INTERNAL
+#endif
+	  && *errnop == ERANGE)
+	/* Give the user a chance to get the same entry with a larger
+	   buffer.  */
+	--entidx;
     }
   while (status == NSS_STATUS_RETURN);