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:
authorChristopher Faylor <me@cgf.cx>2002-11-16 06:50:56 +0300
committerChristopher Faylor <me@cgf.cx>2002-11-16 06:50:56 +0300
commit463e73928295841b3f09dff042a08ec55e499981 (patch)
tree1b7bb80818d0a19e2e68574d774fb5672acd7323
parenta87878a965fc6352378f93ea8ef34f5728c4d7e7 (diff)
* grp.cc (getgroups32): Protect against closing cygheap->user.token.
-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;