mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-19 12:59:21 +08:00
a5bcfe616c
fetch_account_from_windows shortcuts the current user in that it takes the user's domain SID and just adds the matching RID from the token's primary group to create a group SID. How wrong this is can be very simply reproduced: Assuming you run a native process, like cmd, with primary group set to the Administrators builtin group. Run Cygwin's id(1) as child process. id(1) will print a non-existent group as primary group and also add it to the group list. This can only be avoided by not special casing the current user and thus not creating a group SID from partial information. Fixes: 6cc7c925ce86 ("(pwdgrp::fetch_account_from_windows): Default primary group for the current user to primary group from user token.") Signed-off-by: Corinna Vinschen <corinna@vinschen.de>