Eric Blake
2014-02-20 15:09:11 UTC
CVSROOT: /cvs/src
Module name: src
winsup/cygwin : ChangeLog grp.cc
* grp.cc (get_groups): Don't add gid to list if it's ILLEGAL_GID.
(getgrouplist): Return number of groups, just like glibc.
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/ChangeLog.diff?cvsroot=src&r1=1.6341&r2=1.6342
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/grp.cc.diff?cvsroot=src&r1=1.125&r2=1.126
This patch is wrong.Module name: src
winsup/cygwin : ChangeLog grp.cc
* grp.cc (get_groups): Don't add gid to list if it's ILLEGAL_GID.
(getgrouplist): Return number of groups, just like glibc.
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/ChangeLog.diff?cvsroot=src&r1=1.6341&r2=1.6342
http://sourceware.org/cgi-bin/cvsweb.cgi/src/winsup/cygwin/grp.cc.diff?cvsroot=src&r1=1.125&r2=1.126
@@ -626,7 +626,7 @@
}
if (cnt > *ngroups)
ret = -1;
- *ngroups = cnt;
+ ret = *ngroups = cnt;
getgrouplist has the documented behavior of setting *ngroups to the}
if (cnt > *ngroups)
ret = -1;
- *ngroups = cnt;
+ ret = *ngroups = cnt;
number of groups that would be returned, even if the user passed a
too-small *ngroups in to begin with - in that case, ret MUST be -1, but
you just blindly set it to a too-large value. That is, ret must be <=
the initial value of *ngroups, and on output *ngroups must always be
positive even when ret is negative.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org