summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/grp.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-11-16 03:50:56 +0000
committerChristopher Faylor <me@cgf.cx>2002-11-16 03:50:56 +0000
commit463e73928295841b3f09dff042a08ec55e499981 (patch)
tree1b7bb80818d0a19e2e68574d774fb5672acd7323 /winsup/cygwin/grp.cc
parenta87878a965fc6352378f93ea8ef34f5728c4d7e7 (diff)
downloadcygnal-463e73928295841b3f09dff042a08ec55e499981.tar.gz
cygnal-463e73928295841b3f09dff042a08ec55e499981.tar.bz2
cygnal-463e73928295841b3f09dff042a08ec55e499981.zip
* grp.cc (getgroups32): Protect against closing cygheap->user.token.
Diffstat (limited to 'winsup/cygwin/grp.cc')
-rw-r--r--winsup/cygwin/grp.cc3
1 files changed, 2 insertions, 1 deletions
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;