Feature #4568 ยป 0001-file.c-rb_group_member-kill-256K-of-stack-usage.patch
file.c | ||
---|---|---|
static int
|
||
rb_group_member(GETGROUPS_T gid)
|
||
{
|
||
int rv = FALSE;
|
||
#ifndef _WIN32
|
||
if (getgid() == gid || getegid() == gid)
|
||
return TRUE;
|
||
... | ... | |
# endif
|
||
# endif
|
||
{
|
||
GETGROUPS_T gary[NGROUPS];
|
||
GETGROUPS_T *gary;
|
||
int anum;
|
||
gary = xmalloc(NGROUPS * sizeof(GETGROUPS_T));
|
||
anum = getgroups(NGROUPS, gary);
|
||
while (--anum >= 0)
|
||
if (gary[anum] == gid)
|
||
return TRUE;
|
||
while (--anum >= 0) {
|
||
if (gary[anum] == gid) {
|
||
rv = TRUE;
|
||
break;
|
||
}
|
||
}
|
||
xfree(gary);
|
||
}
|
||
# endif
|
||
#endif
|
||
return FALSE;
|
||
return rv;
|
||
}
|
||
#ifndef S_IXUGO
|