* grp.cc (getgrouplist): Fix previous fix so ret is only set to ngroups
if ngroups isn't too small.
This commit is contained in:
parent
2dc219640d
commit
1e3a150969
|
@ -1,3 +1,8 @@
|
||||||
|
2014-02-20 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* grp.cc (getgrouplist): Fix previous fix so ret is only set to ngroups
|
||||||
|
if ngroups isn't too small.
|
||||||
|
|
||||||
2014-02-20 Corinna Vinschen <corinna@vinschen.de>
|
2014-02-20 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* grp.cc (get_groups): Don't add gid to list if it's ILLEGAL_GID.
|
* grp.cc (get_groups): Don't add gid to list if it's ILLEGAL_GID.
|
||||||
|
|
|
@ -624,9 +624,11 @@ getgrouplist (const char *user, gid_t gid, gid_t *groups, int *ngroups)
|
||||||
groups[cnt] = grp->gr_gid;
|
groups[cnt] = grp->gr_gid;
|
||||||
++cnt;
|
++cnt;
|
||||||
}
|
}
|
||||||
|
*ngroups = cnt;
|
||||||
if (cnt > *ngroups)
|
if (cnt > *ngroups)
|
||||||
ret = -1;
|
ret = -1;
|
||||||
ret = *ngroups = cnt;
|
else
|
||||||
|
ret = cnt;
|
||||||
|
|
||||||
syscall_printf ( "%d = getgrouplist(%s, %u, %p, %d)",
|
syscall_printf ( "%d = getgrouplist(%s, %u, %p, %d)",
|
||||||
ret, user, gid, groups, *ngroups);
|
ret, user, gid, groups, *ngroups);
|
||||||
|
|
Loading…
Reference in New Issue