Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-05-14 12:50:37 +0400
committerCorinna Vinschen <corinna@vinschen.de>2013-05-14 12:50:37 +0400
commitee6ed1db45b2da59b18f705909933bbfe1854917 (patch)
tree2dc156885e7e74cf8cb056854bc569b1a8471a45
parentd46cc674ec2e05cb90c8813bdb964b990201ac35 (diff)
* grp.cc (get_groups): Never return error. Always create a group list,
even if it's empty.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/grp.cc15
2 files changed, 10 insertions, 10 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 6d72b0d03..4c2693f71 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * grp.cc (get_groups): Never return error. Always create a group list,
+ even if it's empty.
+
2013-05-13 Christopher Faylor <me.cygwin2013@cgf.cx>
* include/cygwin/version.h: Bump api minor number to reflect previous
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index a2ab5b635..59ec5becc 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -441,21 +441,16 @@ getgroups (int gidsetsize, __gid16_t *grouplist)
static int
get_groups (const char *user, gid_t gid, cygsidlist &gsids)
{
- int ret = -1;
-
cygheap->user.deimpersonate ();
struct passwd *pw = internal_getpwnam (user);
struct group *gr = internal_getgrgid (gid);
cygsid usersid, grpsid;
- if (!usersid.getfrompw (pw) || !grpsid.getfromgr (gr))
- set_errno (EINVAL);
- else if (get_server_groups (gsids, usersid, pw))
- {
- gsids += grpsid;
- ret = 0;
- }
+ if (usersid.getfrompw (pw))
+ get_server_groups (gsids, usersid, pw);
+ if (grpsid.getfromgr (gr))
+ gsids += grpsid;
cygheap->user.reimpersonate ();
- return ret;
+ return 0;
}
extern "C" int