]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: newgrp: only allow group from supplementary group list
authorCorinna Vinschen <corinna@vinschen.de>
Sat, 24 Feb 2024 11:59:28 +0000 (12:59 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Sat, 24 Feb 2024 12:12:37 +0000 (13:12 +0100)
commit32024ec7f723112a46dae8c7ff17b5ec1157021e
tree4cb07f206fd681fb01f70e1382f87e90159725ef
parent08df2e23a75190fced8c1a2446ebaee4f469eb96
Cygwin: newgrp: only allow group from supplementary group list

Windows only allows to set the primary group to a group already
present in the TOKEN_GROUP list.  Cygwin OTOH fakes success at
setgid() time, to allow a subsequent call to setuid() to do
the actual account switching.  To have a sane behaviour in the
command line tool, check group membership and disallow to switch
to groups other than those already present in the user token.

Fixes: 8bd56ec873453 ("Cygwin: newgrp: first full version")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/doc/utils.xml
winsup/utils/newgrp.c
This page took 0.033596 seconds and 5 git commands to generate.