This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.23-525-g73fb56a
- From: schwab at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 30 Jun 2016 11:57:21 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.23-525-g73fb56a
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 73fb56a4d51fd4437e4cde6dd3c8077a610f88a8 (commit)
from 3631c9742a8740777e09d9e8f6f5e6cccaf7340c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=73fb56a4d51fd4437e4cde6dd3c8077a610f88a8
commit 73fb56a4d51fd4437e4cde6dd3c8077a610f88a8
Author: Andreas Schwab <schwab@suse.de>
Date: Thu Jun 16 12:44:29 2016 +0200
Return proper status from _nss_nis_initgroups_dyn (bug 20262)
diff --git a/ChangeLog b/ChangeLog
index f7803ee..9131b1f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-06-30 Andreas Schwab <schwab@suse.de>
+
+ [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.
+
2016-06-29 H.J. Lu <hongjiu.lu@intel.com>
[BZ #18645]
diff --git a/nis/nss_nis/nis-initgroups.c b/nis/nss_nis/nis-initgroups.c
index dec385c..0368667 100644
--- a/nis/nss_nis/nis-initgroups.c
+++ b/nis/nss_nis/nis-initgroups.c
@@ -266,7 +266,7 @@ _nss_nis_initgroups_dyn (const char *user, gid_t group, long int *start,
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 *user, gid_t group, long int *start,
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 *user, gid_t group, long int *start,
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 *user, gid_t group, long int *start,
}
}
}
- while (status == NSS_STATUS_SUCCESS);
done:
while (intern.start != NULL)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
nis/nss_nis/nis-initgroups.c | 16 +++++++++++-----
2 files changed, 18 insertions(+), 5 deletions(-)
hooks/post-receive
--
GNU C Library master sources