Skip to content

Commit 2ca21a3

Browse files
committed
Cygwin: internal_getlogin: always call internal_getgroups
Commit 29b7313 ("* cygheap.h (enum cygheap_pwdgrp::cache_t): Remove.") changed an initial conditional to skip calling internal_getgroups() if we're running with cygserver account caching in place. This breaks changing the primary group. Unfortunately the commit message doesn't explain why the change was made. Just calling internal_getgroups() all the time fixes this behaviour. Fixes: 29b7313 ("* cygheap.h (enum cygheap_pwdgrp::cache_t): Remove.") Addresses: https://cygwin.com/pipermail/cygwin/2026-January/259250.html Signed-off-by: Corinna Vinschen <corinna@vinschen.de> (cherry picked from commit 169a760)
1 parent 53cfd72 commit 2ca21a3

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

winsup/cygwin/release/3.6.7

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ Fixes:
33

44
- Guard c32rtomb against invalid input characters.
55
Addresses a testsuite error in current gawk git master.
6+
7+
- Allow changing primary group even when running with cygserver account
8+
caching.
9+
Addresses: https://cygwin.com/pipermail/cygwin/2026-January/259250.html

winsup/cygwin/uinfo.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ internal_getlogin (cygheap_user &user)
153153
and the primary group in the token. */
154154
pwd = internal_getpwsid (user.sid (), &cldap);
155155
pgrp = internal_getgrsid (user.groups.pgsid, &cldap);
156-
if (!cygheap->pg.nss_cygserver_caching ())
157-
internal_getgroups (0, NULL, &cldap);
156+
internal_getgroups (0, NULL, &cldap);
158157
if (!pwd)
159158
debug_printf ("user not found in passwd DB");
160159
else

0 commit comments

Comments
 (0)