summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/grp.cc3
2 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index bb713a058..5d916a6b4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2002-11-15 Pierre Humblet <pierre.humblet@ieee.org>
+
+ * grp.cc (getgroups32): Protect against closing cygheap->user.token.
+
2002-11-15 Christopher Faylor <cgf@redhat.com>
* include/cygwin/version.h: Bump API_MINOR to accommodate below
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index 083b9db75..eb7990a02 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -372,7 +372,8 @@ getgroups32 (int gidsetsize, __gid32_t *grouplist, __gid32_t gid,
++cnt;
if (gidsetsize && cnt > gidsetsize)
{
- CloseHandle (hToken);
+ if (hToken != cygheap->user.token)
+ CloseHandle (hToken);
goto error;
}
break;