X-Recipient: archive-cygwin AT delorie DOT 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 AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT 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 , cygwin AT cygwin DOT com Subject: Re: Switching groups with newgrp - how to get the new group with |GetTokenInformation()| ? In-Reply-To: References: 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 AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrey Repin via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Andrey Repin Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" 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