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>