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
+2014-05-26 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ [BZ #16878]
+ * nscd/netgroupcache.c (addgetnetgrentX): Look for
+ NSS_STATUS_TRYAGAIN to indicate insufficient buffer space.
+ * nscd/nss_files/files-netgrp.c (_nss_netgroup_parseline): Use
+ NSS_STATUS_TRYAGAIN to indicate insufficient buffer space.
+
2014-03-12 Siddhesh Poyarekar <siddhesh@redhat.com>
[BZ #16695]
* The following bugs are resolved with this release:
- 15946, 16545, 16574, 16623, 16695, 16882, 16885, 16916, 16932, 16943,
- 16958, 17048, 17069.
+ 15946, 16545, 16574, 16623, 16695, 16878, 16882, 16885, 16916, 16932,
+ 16943, 16958, 17048, 17069.
* CVE-2014-4043 The posix_spawn_file_actions_addopen implementation did not
copy the path argument. This allowed programs to cause posix_spawn to
int e;
status = getfct.f (&data, buffer + buffilled,
buflen - buffilled - req->key_len, &e);
- if (status == NSS_STATUS_RETURN
- || status == NSS_STATUS_NOTFOUND)
- /* This was either the last one for this group or the
- group was empty. Look at next group if available. */
- break;
if (status == NSS_STATUS_SUCCESS)
{
if (data.type == triple_val)
}
}
}
- else if (status == NSS_STATUS_UNAVAIL && e == ERANGE)
+ else if (status == NSS_STATUS_TRYAGAIN && e == ERANGE)
{
buflen *= 2;
buffer = xrealloc (buffer, buflen);
}
+ else if (status == NSS_STATUS_RETURN
+ || status == NSS_STATUS_NOTFOUND
+ || status == NSS_STATUS_UNAVAIL)
+ /* This was either the last one for this group or the
+ group was empty or the NSS module had an internal
+ failure. Look at next group if available. */
+ break;
}
enum nss_status (*endfct) (struct __netgrent *);
if (cp - host > buflen)
{
*errnop = ERANGE;
- status = NSS_STATUS_UNAVAIL;
+ status = NSS_STATUS_TRYAGAIN;
}
else
{