Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cygwin: uinfo: prefer token primary group
internal_getlogin overwrites the process token primary group if it differs from the primary group as stored in the passwd DB. However, this also overwrites the primary group of the process if it has been deliberately changed by a former process (e. g., newgrp), and the current process has a non-Cygwin process as parent. Our docs claim we restrict overwriting the primary group to local, non-domain user accounts anyway, and it was actually meant this way. So check for exactly that before overwriting the primary group in the token: It's only allowed if the user is a local account and the primary group in the token is still the default group "None". Fixes: 6cc7c92 ("(internal_getlogin): Give primary group from user token more weight.") Signed-off-by: Corinna Vinschen <[email protected]>
- Loading branch information