On Fri, 16 Jan 2026 12:01:53 +0100
Corinna Vinschen wrote:
> From: Corinna Vinschen <[email protected]>
> 
> Commit 29b7313d2225 ("* 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: 29b7313d2225 ("* cygheap.h (enum cygheap_pwdgrp::cache_t): Remove.")
> Addresses: https://cygwin.com/pipermail/cygwin/2026-January/259250.html
> Signed-off-by: Corinna Vinschen <[email protected]>
> ---
>  winsup/cygwin/release/3.6.7 | 4 ++++
>  winsup/cygwin/uinfo.cc      | 3 +--
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/winsup/cygwin/release/3.6.7 b/winsup/cygwin/release/3.6.7
> index defe55ffe75e..050f6008084e 100644
> --- a/winsup/cygwin/release/3.6.7
> +++ b/winsup/cygwin/release/3.6.7
> @@ -3,3 +3,7 @@ Fixes:
>  
>  - Guard c32rtomb against invalid input characters.
>    Addresses a testsuite error in current gawk git master.
> +
> +- Allow changing primary group even when running with cygserver account
> +  caching.
> +  Addresses: https://cygwin.com/pipermail/cygwin/2026-January/259250.html
> diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
> index 1eb52f14578c..73e61cbffc82 100644
> --- a/winsup/cygwin/uinfo.cc
> +++ b/winsup/cygwin/uinfo.cc
> @@ -153,8 +153,7 @@ internal_getlogin (cygheap_user &user)
>       and the primary group in the token. */
>    pwd = internal_getpwsid (user.sid (), &cldap);
>    pgrp = internal_getgrsid (user.groups.pgsid, &cldap);
> -  if (!cygheap->pg.nss_cygserver_caching ())
> -    internal_getgroups (0, NULL, &cldap);
> +  internal_getgroups (0, NULL, &cldap);
>    if (!pwd)
>      debug_printf ("user not found in passwd DB");
>    else
> -- 
> 2.52.0

LGTM.

-- 
Takashi Yano <[email protected]>

Reply via email to