SHA256
1
0
forked from pool/glibc
glibc/nis-initgroups-status.patch
Andreas Schwab e794ddb00b Accepting request 407107 from home:Andreas_Schwab:Factory
- strncat-avoid-array-bounds-warning.patch: Avoid array-bounds warning for
  stncat on i586 (BZ #20260)
- Update glibc.keyring
- Unset MALLOC_CHECK_ during testsuite run

- nsswitch.conf: Add fallback to files for passwd and group to prepare for
  libnsl removal.

- nis-initgroups-status.patch: Return proper status from
  _nss_nis_initgroups_dyn (bsc#984269, BZ #20262)
- robust-mutex-deadlock.patch: Fix generic __lll_robust_timedlock_wait to
  check for timeout (bsc#985170, BZ #20263)

OBS-URL: https://build.opensuse.org/request/show/407107
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=442
2016-07-07 12:43:40 +00:00

54 lines
1.4 KiB
Diff

[BZ #20262]
* nis/nss_nis/nis-initgroups.c (_nss_nis_initgroups_dyn): Return
NSS_STATUS_SUCCESS when done. Return NSS_STATUS_TRYAGAIN when out
of memory.
Index: glibc-2.23/nis/nss_nis/nis-initgroups.c
===================================================================
--- glibc-2.23.orig/nis/nss_nis/nis-initgroups.c
+++ glibc-2.23/nis/nss_nis/nis-initgroups.c
@@ -266,7 +266,7 @@ _nss_nis_initgroups_dyn (const char *use
tmpbuf = __alloca (buflen);
- do
+ while (1)
{
while ((status =
internal_getgrent_r (&grpbuf, tmpbuf, buflen, errnop,
@@ -275,8 +275,11 @@ _nss_nis_initgroups_dyn (const char *use
tmpbuf = extend_alloca (tmpbuf, buflen, 2 * buflen);
if (status != NSS_STATUS_SUCCESS)
- goto done;
-
+ {
+ if (status == NSS_STATUS_NOTFOUND)
+ status = NSS_STATUS_SUCCESS;
+ goto done;
+ }
g = &grpbuf;
if (g->gr_gid != group)
@@ -304,7 +307,11 @@ _nss_nis_initgroups_dyn (const char *use
newgroups = realloc (groups, newsize * sizeof (*groups));
if (newgroups == NULL)
- goto done;
+ {
+ status = NSS_STATUS_TRYAGAIN;
+ *errnop = errno;
+ goto done;
+ }
*groupsp = groups = newgroups;
*size = newsize;
}
@@ -316,7 +323,6 @@ _nss_nis_initgroups_dyn (const char *use
}
}
}
- while (status == NSS_STATUS_SUCCESS);
done:
while (intern.start != NULL)