diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-02-20 13:55:57 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-02-20 13:55:57 +0000 |
commit | 7f57a4ea14acc4bd041b38390fbc9cc5765c5772 (patch) | |
tree | eee8d07cb107c9cd0dd1bc02b1097409d72e051a | |
parent | 23c0f215943788c10b623a8a742146917fb32250 (diff) | |
download | cygnal-7f57a4ea14acc4bd041b38390fbc9cc5765c5772.tar.gz cygnal-7f57a4ea14acc4bd041b38390fbc9cc5765c5772.tar.bz2 cygnal-7f57a4ea14acc4bd041b38390fbc9cc5765c5772.zip |
* grp.cc (get_groups): Don't add gid to list if it's ILLEGAL_GID.
(getgrouplist): Return number of groups, just like glibc.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/grp.cc | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 71717883e..506a63bcd 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2014-02-20 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (get_groups): Don't add gid to list if it's ILLEGAL_GID. + (getgrouplist): Return number of groups, just like glibc. + 2014-02-19 Corinna Vinschen <corinna@vinschen.de> * passwd.cc (pg_ent::setent): Initialize cygheap domain info. diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc index 18e091642..665cb173d 100644 --- a/winsup/cygwin/grp.cc +++ b/winsup/cygwin/grp.cc @@ -570,7 +570,7 @@ get_groups (const char *user, gid_t gid, cygsidlist &gsids) cygsid usersid, grpsid; if (usersid.getfrompw (pw)) get_server_groups (gsids, usersid, pw); - if (grpsid.getfromgr (grp)) + if (gid != ILLEGAL_GID && grpsid.getfromgr (grp)) gsids += grpsid; cygheap->user.reimpersonate (); } @@ -626,7 +626,7 @@ getgrouplist (const char *user, gid_t gid, gid_t *groups, int *ngroups) } if (cnt > *ngroups) ret = -1; - *ngroups = cnt; + ret = *ngroups = cnt; syscall_printf ( "%d = getgrouplist(%s, %u, %p, %d)", ret, user, gid, groups, *ngroups); |