File 0004-nss_ldap-getent-skip-invalid-uidgidnumber.dif of Package nss_ldap.13245

Index: nss_ldap-265/ldap-pwd.c
===================================================================
--- nss_ldap-265.orig/ldap-pwd.c
+++ nss_ldap-265/ldap-pwd.c
@@ -121,7 +121,17 @@ _nss_ldap_parse_pw (LDAPMessage * e,
   stat =
     _nss_ldap_assign_attrval (e, AT (uidNumber), &uid, &tmp, &tmplen);
   if (stat != NSS_SUCCESS)
-    return stat;
+    {
+      /*
+       * uidNumber is to large to fit into the fixed size tmpbuf buffer,
+       * handle this as if it was a Schema violation to skip this entry,
+       * such large ids aren't valid
+       */
+      if ( stat == NSS_TRYAGAIN )
+	stat = NSS_NOTFOUND;
+      return stat;
+    }
+
   if (*uid == '\0')
     pw->pw_uid = UID_NOBODY;
   else
@@ -138,7 +148,16 @@ _nss_ldap_parse_pw (LDAPMessage * e,
     _nss_ldap_assign_attrval (e, ATM (LM_PASSWD, gidNumber), &gid, &tmp,
                               &tmplen);
   if (stat != NSS_SUCCESS)
-    return stat;
+    {
+      /*
+       * gidNumber is to large to fit into the fixed size tmpbuf buffer,
+       * handle this as if it was a Schema violation to skip this entry,
+       * such large ids aren't valid
+       */
+      if ( stat == NSS_TRYAGAIN )
+	stat = NSS_NOTFOUND;
+      return stat;
+    }
   if (*gid == '\0')
     pw->pw_gid = GID_NOBODY;
   else