From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by sourceware.org (Postfix) with ESMTPS id 5A5583858D34 for ; Sat, 24 Feb 2024 16:57:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A5583858D34 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSW.ab.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=SystematicSW.ab.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5A5583858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=216.40.44.17 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708793837; cv=none; b=PbvH6eTbxhFpXLpxz4eGKWL0ESWr8ZukByzy1SE7DvGVyG8nNeIddC5pP/YN2dnwtBM6LzFRhC2H1YfIi5HVceK/ctgwf31N6yLrcbp+4u/wUvy8FhVrBo/cZUOXVTPdwhdbq9liikGhPA+oA/fcS2mCbSjBOTN787+EQDnqeJU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708793837; c=relaxed/simple; bh=dI3qBVcwM+1PXqQPkNZcrtwW9/2AqSm8SeyQWBf6Ns0=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=k3lYNoZ/cw1tkIP74IlQufA8f46SMrh7F2+FpyPkb7JqObcBgtL1j4a36Htv/zT7SLt78uGkNX/woho27wgdcRk+7bv5gwuJT8pkv85p+CK+Mq5sjdR5ojdR6V4bE1/hn/orOlgu3Q6Ucc9evxXH5DhFrUeRGGor3SEdhqT8VZk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from omf06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C5EC71A01C8 for ; Sat, 24 Feb 2024 16:57:13 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: Brian.Inglis@SystematicSW.ab.ca) by omf06.hostedemail.com (Postfix) with ESMTPA id 55FC82000E for ; Sat, 24 Feb 2024 16:57:12 +0000 (UTC) Message-ID: <03d0eb6d-2f0a-465a-8fb6-fa9bbbd19c12@SystematicSW.ab.ca> Date: Sat, 24 Feb 2024 09:57:11 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: cygwin@cygwin.com Subject: Re: Switching groups with newgrp - how to get the new group with |GetTokenInformation()| ? Content-Language: en-CA To: cygwin@cygwin.com References: From: Brian Inglis Organization: Systematic Software In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 55FC82000E X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Stat-Signature: a8z7snh6c9ajcytesgcb4ar88yx4s3qd X-Rspamd-Server: rspamout01 X-Session-Marker: 427269616E2E496E676C69734053797374656D6174696353572E61622E6361 X-Session-ID: U2FsdGVkX188DpimEB9rP/QLuN2EpZ0qZJ6o9nqxQt8= X-HE-Tag: 1708793832-518900 X-HE-Meta: U2FsdGVkX18oZncd6ZN91l+/EiFz6qoW+kAFogpIqQYjyGw/B2JcgEB2PgmT46z7dc9/nITLH1nJ7ylMNztJw3441W+oc2+kdZMxcz3PWBKjXvrkEN5ThvHetXtCp77jQlxJwwpb2GUc99cvFMZF7sRyyblrfustG21usUCNBMGED+WP2w2Vf40VaU6WkIRR+TQBHlmqZf9JF/3/y2RyEcUrk+fx5VoIlwJv15wfrtzntM3k8NtSWaoBYujKA906fwOPiriIyubBlbA6BtKbfMfI76q6KDABEGvXRNaSdf68QTQoQP/I3lgcYXwshiFtVU5ulQjq08f/YCPgDg42hQp2BMW5fQD/wMtlf3ROoS3uHnCKjbWMSg== X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2024-02-23 14:15, Dan Shelton via Cygwin wrote: > On Fri, 23 Feb 2024 at 19:45, Roland Mainz via Cygwin wrote: >> After that /usr/bin/chgrp on Cygwin works on the NFSv4.1 filesystem, >> but if I do a /usr/bin/newgrp+/usr/bin/touch it will not create files >> with that new group, because nfsd_debug.exe only sees the default >> primary group, not the new primary group set by /usr/bin/newgrp. >> >> Or is there a mistake - do I have to add the current user to the >> Windows localgroup first somehow (like usermod on Linux) ? > > Yes, there is a mistake. You have to add the intended user to that group. > > Example: > net localgroup mywingrp1 mywinuser44 /add > > HOWEVER, there is another Cygwin bug: > "getent group mywingrp1" does not list any group members, even after > "net localgroup mywingrp1 mywinuser44 /add", which is a POSIX > violation. No POSIX violation as getent and nsswitch came from Solaris, and despite adoption by Linux, BSDs, and Cygwin, is not standardized as of SUSv5? draft 202x_d4.1. Cygwin `getent group` depends on `/etc/nsswitch.conf` settings, defaults to `files db`, and lists the contents of the entries in `/etc/group` and/or Security Account Manager SAM groups and/or Active Directory AD groups (could take a long while initially and is faster with cygserver caching). See `getent(1)`. -- Take care. Thanks, Brian Inglis Calgary, Alberta, Canada La perfection est atteinte Perfection is achieved non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut -- Antoine de Saint-Exupéry