On 04/12/2025 21:50, Brian Inglis via Cygwin wrote:
On 2025-12-04 08:00, Jon Turney via Cygwin wrote:
Actually, I think this is a shortcoming of the cygwin version of newgrp.
The SUS description [1] of newgrp allows a numeric group id to be
specified.
(In fact, it includes the clarifying remark "If group is a non-
negative numeric string and exists in the group database as a group
name, the numeric group ID associated with that group name will be
used as the group ID", which suggests a, um, straightforward
implementation)
But it seems that our implementation only currently handles a group
name (See [2]).
[1] https://pubs.opengroup.org/onlinepubs/7908799/xcu/newgrp.html
That's OG SUSV2 1997 - current is at:
https://pubs.opengroup.org/onlinepubs/9799919799/utilities/newgrp.html
[2] https://cygwin.com/cgit/newlib-cygwin/tree/winsup/utils/newgrp.c#n166
Thanks Jon, Brian,
do you know also why the group in /etc/passwd is ignored and
"Nobody/Nessuno" is used ?
$ cat passwd
Marco:*:197608:545:U-DESKTOP-L2T1NQ9\Utente,S-1-5-21-1151457081-841113255-780074606-1000:/home/Marco:/bin/bash
$ id
uid=197608(Marco) gid=197121(NESSUNO)
groups=197121(NESSUNO),545(Users),4(INTERACTIVE),66049(ACCESSO
CONSOLE),11(Authenticated Users),15(Questa organizzazione),113(Account
locale),4095(CurrentSession),66048(LOCALE),262154(Autenticazione
NTLM),401408(Livello obbligatorio medio)
$ uname -svr
CYGWIN_NT-10.0-26200 3.6.5-1.x86_64 2025-10-09 17:21 UTC
Regards
Marco
--
Problem reports: https://cygwin.com/problems.html
FAQ: https://cygwin.com/faq/
Documentation: https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple