coreutils/coreutils-8.3-groupfix.patch

25 lines
647 B
Diff
Raw Permalink Normal View History

2012-02-01 14:36:01 +04:00
--- coreutils-8.3/lib/getugroups.c.groups 2010-01-04 17:19:05.000000000 +0100
+++ coreutils-8.3/lib/getugroups.c 2010-01-11 07:09:44.000000000 +0100
@@ -75,8 +75,12 @@
errno = 0;
grp = getgrent ();
- if (grp == NULL)
+ if (grp == NULL) {
+ if (errno == ENOENT)
+ /* expected at the end of the group list, so ignore errno */
+ errno =0;
break;
+ }
for (cp = grp->gr_mem; *cp; ++cp)
{
@@ -102,6 +106,7 @@
if (count == INT_MAX)
{
errno = EOVERFLOW;
+ count = -1;
goto done;
}
count++;