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>2002-06-03 21:11:14 +0400
committerCorinna Vinschen <corinna@vinschen.de>2002-06-03 21:11:14 +0400
commit656c31920bcccd705d53e15f0184fc0e5e769a6a (patch)
tree8c6dbb0cd73c8c42639ccb9d1051be8b891094ec
parent1eb934b7c5a4f5cfb0b7dcb04f17e24cb5989da4 (diff)
* syscalls.cc (setegid32): Verify the correctness of the gid
of the group returned by getgrgid32.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/syscalls.cc3
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index adac1b25d..654b16742 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
+ * syscalls.cc (setegid32): Verify the correctness of the gid
+ of the group returned by getgrgid32.
+
+2002-06-03 Pierre Humblet <pierre.humblet@ieee.org>
+
* security.cc (lsa2wchar): Suppressed.
(get_lsa_srv_inf): Suppressed.
(get_logon_server_and_user_domain): Suppressed.
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index a936a21fd..54418c0a9 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -2175,7 +2175,8 @@ setegid32 (__gid32_t gid)
cygsid gsid;
HANDLE ptok;
- if (!(gsid.getfromgr (getgrgid32 (gid))))
+ struct __group32 * gr = getgrgid32 (gid);
+ if (!gr || gr->gr_gid != gid || !gsid.getfromgr (gr))
{
set_errno (EINVAL);
return -1;