about summary refs log tree commit diff
path: root/nss/nss_files
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2014-05-26 11:40:08 +0530
committerAllan McRae <allan@archlinux.org>2014-09-05 22:44:10 +1000
commit6ccc1c41f52f93548b5eb64d106219e287052472 (patch)
treeef95b0851f1f46376ab14d7c45e318a6efb54276 /nss/nss_files
parent4e27332819b6151ccb5031d0efd718d802168573 (diff)
downloadglibc-6ccc1c41f52f93548b5eb64d106219e287052472.tar.gz
glibc-6ccc1c41f52f93548b5eb64d106219e287052472.tar.xz
glibc-6ccc1c41f52f93548b5eb64d106219e287052472.zip
Use NSS_STATUS_TRYAGAIN to indicate insufficient buffer (BZ #16878)
The netgroups nss modules in the glibc tree use NSS_STATUS_UNAVAIL
(with errno as ERANGE) when the supplied buffer does not have
sufficient space for the result.  This is wrong, because the canonical
way to indicate insufficient buffer is to set the errno to ERANGE and
the status to NSS_STATUS_TRYAGAIN, as is used by all other modules.

This fixes nscd behaviour when the nss_ldap module returns
NSS_STATUS_TRYAGAIN to indicate that a netgroup entry is too long to
fit into the supplied buffer.

(cherry picked from commit c3ec475c5dd16499aa040908e11d382c3ded9692)

Conflicts:
	NEWS
Diffstat (limited to 'nss/nss_files')
-rw-r--r--nss/nss_files/files-netgrp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nss/nss_files/files-netgrp.c b/nss/nss_files/files-netgrp.c
index 34eae4c5be..bc0b367da8 100644
--- a/nss/nss_files/files-netgrp.c
+++ b/nss/nss_files/files-netgrp.c
@@ -252,7 +252,7 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *result,
   if (cp - host > buflen)
     {
       *errnop = ERANGE;
-      status = NSS_STATUS_UNAVAIL;
+      status = NSS_STATUS_TRYAGAIN;
     }
   else
     {