From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 9D52C3858D34; Sat, 24 Feb 2024 18:57:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D52C3858D34 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1708801033; bh=ctiz5CsN04m5Mqbc92C+jmqLdv6lXoNl6Q1C0J5IzuU=; h=Date:From:To:Subject:Reply-To:References:In-Reply-To:From; b=JvgW9VP8YsUX4p2E5BTsmohYxaA1sgSVbik1VA61pvDZIO95+NRNEf6ySwEb4Wy9I BHwOEj3HxQXCSHXJPV33L6tvWPD1lkP9N4ESZKNN+SMboRK076KbkwnkUawujfSZ60 dIN7gquMZCgVwjuh/7Ps6ZLEDrwjHlt4ZWPZhTFY= Received: by calimero.vinschen.de (Postfix, from userid 500) id D0837A8075F; Sat, 24 Feb 2024 19:57:11 +0100 (CET) Date: Sat, 24 Feb 2024 19:57:11 +0100 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: Will all SIDs fit into |SECURITY_MAX_SID_SIZE| bytes ? / was: Re: Switching groups with newgrp - how to get the new group with |GetTokenInformation()| ? Message-ID: Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: On Feb 24 15:38, Roland Mainz via Cygwin wrote: > On Thu, Feb 22, 2024 at 8:11 PM Corinna Vinschen via Cygwin > wrote: > > On Feb 22 18:38, Roland Mainz via Cygwin wrote: > > > If I switch the current user's group with /usr/bin/newgrp, how can a > > > (native) Win32 process use > > > |GetTokenInformation(GetCurrentThreadToken(), ...)| to find out which > > > group is the new "current group" (e.g. which |TokenInformationClass| > > > should I use) ? > > > > PSID sidbuf = (PSID) alloca (SECURITY_MAX_SID_SIZE); > [snip] > > Win32/NT API question: All known SIDs will fit into > |SECURITY_MAX_SID_SIZE| bytes, right ? I'm asking because right now > the ms-nfs41-client code assumes that all SIDs use a variable amount > of memory, and we always have to ask the Win32/NT API about the number > of bytes to allocate. If |SECURITY_MAX_SID_SIZE| is the global maximum > limit for all Windows versions, then we could simplify the code a > lot... Yes. ACLs are size restricted to 64K, though, but that shouldn't be much of a problem usally. Corinna