File 0011-When-invoked-via-glibc-the-input-buffer-is-enlarged.patch of Package nss_ldap.13245

From a12feab75b33a6fc09233794eff203416ca6ebd8 Mon Sep 17 00:00:00 2001
From: HouzuoGuo <guohouzuo@gmail.com>
Date: Fri, 26 Aug 2016 11:07:15 +0200
Subject: [PATCH] When invoked via glibc, the input buffer is enlarged only if
 errnop is set to ERANGE, so set it that way to comply with glibc's
 expectation.

Authored by William Preston <wpreston@suse.com> on 2016-08-25.

diff --git a/ldap-netgrp.c b/ldap-netgrp.c
index ff70dba..bc7d711 100644
--- a/ldap-netgrp.c
+++ b/ldap-netgrp.c
@@ -382,7 +382,9 @@ NSS_STATUS
 _nss_ldap_getnetgrent_r (struct __netgrent *result,
 			 char *buffer, size_t buflen, int *errnop)
 {
-  return _nss_ldap_parse_netgr (result, buffer, buflen);
+  NSS_STATUS status = _nss_ldap_parse_netgr (result, buffer, buflen);
+  if (status == NSS_TRYAGAIN) *errnop = ERANGE;
+  return status;
 }
 #endif /* HAVE_NSS_H */
 
-- 
2.6.6