X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3134E3849AC4
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1714122369;
	bh=m5jf+7ldTY2CUF5htvqo8fKsqjnQC3S6v8xNPnxmtEk=;
	h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=Zui2E4ryHWjwzXcyo8WWRHjD/9NxrqbfjX5vlaVKGixi5xwBmra3woQdplCbeLKKp
	 s7al1a0i8G3+CEoi07/HxCPSKoi8+Sh5QP76bQOXneZ0xTebhUyrYm9BXZc9zfrCAl
	 6tdwQi6Qfz89YwNBfdhkXgN8Y7uzkF5oSpSQ1gJ4=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2D1CC3858C50
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2D1CC3858C50
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714122313; cv=none;
 b=N3L1rO0Hi0XPJvTilwav/0bO6YNhZFz/oLANE19YvAx+OugBajHWPGJXEU5Rf77UYnpkkJJitD5bCyveIpGrZCDZJ96TPR5UGUl30PeB9AbZBZ7cIULgyNtg7NBSJUo16GrJDVWL21xLH40bYREHoKMDBWuBUMYuu9I+kwmoksM=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1714122313; c=relaxed/simple;
 bh=BW7itYbHwZ2isRnLa3KnYfuiUyCsNFh2ppDJarFOUW0=;
 h=DKIM-Signature:Date:From:Message-ID:To:Subject:MIME-Version;
 b=ih8Dh8cXVG+L3Itcpkx+P4F5ztj3TV6hSYnY87FTxWZdDUOxWRdCCvlILmnHCYW0N0NnSSiMGN+LN9XbK0iyXp7V2azy9Its2WfTUHY0cmnlN+PZ59Vb2uWd1Rpf26DlViy5YZsIhkFhRuLgQ/ax1MXVrGp1sgkSr7liZjvtKVg=
ARC-Authentication-Results: i=1; server2.sourceware.org
X-Yandex-Fwd: 1
Date: Fri, 26 Apr 2024 12:04:06 +0300
X-Mailer: The Bat! (v9.3.4) Professional
Message-ID: <1509925074.20240426120406@yandex.ru>
To: Dan Shelton <dan.f.shelton@gmail.com>, cygwin@cygwin.com
Subject: Re: Switching groups with newgrp - how to get the new group with
 |GetTokenInformation()| ?
In-Reply-To: <CAAvCNcDrVDLETrCTTH6EPEx_bs=Ao8kC5rev1-Xs8Qn1CWbvdQ@mail.gmail.com>
References: <CAKAoaQnFxij4Np-jg+bOLEpiSziCfamFrJ2FR_JeO+Sv_Td2Kg@mail.gmail.com> 
 <ZdecXZNUgQ3i0hYN@calimero.vinschen.de>
 <CAKAoaQ=rCwVHnHAqfd5C3kC45GPE4ZHbbgCWrdM64sojLMuMyA@mail.gmail.com>
 <Zdi-CnGX3CwWA0nl@calimero.vinschen.de>
 <CAKAoaQ=kLW3houqanjcN9Qk1++BtgW-dNRiXjLYwCRTYEzoN=w@mail.gmail.com>
 <CAAvCNcCHAVooYX2_tUHHnUYvWRKHWhBwxmKws7AcqjOo-sQd+g@mail.gmail.com>
 <Zdnq5yJha75NTpgd@calimero.vinschen.de>
 <CAAvCNcAEAr0gFdR_excafHq8+cYjDvf_APb1So-AAWGSu2+zTQ@mail.gmail.com>
 <ZehpEr18QUP6C3Ge@calimero.vinschen.de>
 <CAAvCNcCcfO9br8avaNo6tg-FLHef4aH9P8AVyr95bs9ArTTSJQ@mail.gmail.com>
 <Ze83202vozq9T8Jj@calimero.vinschen.de>
 <CAAvCNcDrVDLETrCTTH6EPEx_bs=Ao8kC5rev1-Xs8Qn1CWbvdQ@mail.gmail.com>
MIME-Version: 1.0
X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT,
 NICE_REPLY_A, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS,
 TXREP, XM_LIGHT_HEAVY autolearn=no autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
 server2.sourceware.org
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Andrey Repin via Cygwin <cygwin@cygwin.com>
Reply-To: cygwin@cygwin.com
Cc: Andrey Repin <anrdaemon@yandex.ru>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

Greetings, Dan Shelton!

>> Then just change /etc/nsswitch.conf to enumerate "local" as well
>> and be done with it.

> That file is read-only for some customer installations, and we are not
> allowed to touch it.

Then tell the system administrator to touch it.

>>
>> You can even go so far as to use the Windows enumerator, i.e.,
>>
>>   $ net localgroup
>>
>> and than script it to use its output as input to getent group
>> for only the groups you really need info for.

> net localgroup changes layout and messages per system locale. That
> might be nice to watch as a human user, but impossible to write a
> parser. That damn thing does not honor LC_ALL, and I am now basically
> forced to write custom parsers for each customers language.

Try `chcp 65001` before calling to it. It may behave better then.


-- 
With best regards,
Andrey Repin
Friday, April 26, 2024 12:02:05

Sorry for my terrible english...


-- 
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
