delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/02/26/11:13:53

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6DB8D385842C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1708964030;
bh=0PxinLq00YHB+kWJiCdQq0uxdJjBZPYF1cAagLNeNU4=;
h=To:CC:Subject:Date:References:In-Reply-To:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=JrPaBnXZkQcM1GQ05ktv5bouYzMnPVe3VsACBX6SI40X6+UsjCVGsJsOwcNK9eZOh
cAvRInEe1ZXoZFCB3/bFgK7MkF01q8ctqG6JlqCCTL0X6yGGl9UCWP+LRR8QssKZ7e
DCiUHbYSlNrLo6Lji6vFMZNPCRa/Mb0+VnQihcsI=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D33713858CDB
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D33713858CDB
ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1708963995; cv=pass;
b=aQMBF/R/LCZIqyd2CCI0ILyusys0QyIlUZOCMgndoADUxrorYuD0PYsrjljUxkonlsdF3gjUTYvaIwWRsPPOAutrXbw1o2ZMrK6v5d7wVi0GN/QFbskD8BlrPgKOJoB3ToOOB9FffXvqwGwSKMLU7wuXpbVZ67BiGDyFymmuA44=
ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key;
t=1708963995; c=relaxed/simple;
bh=URajHiSugO3Zz/Zxet2cvGwnqDo4PVXoYm8u4LXge9s=;
h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID:
MIME-Version;
b=Z5mxQm3UciD08D5ZiMEvXSkotch2karXZ05Lc/5D/NeO5tGj6GXykHNiEF9RQjzkSanME5/W8tPpQzKW9UjQYzS797GfbWpMRGgQzxBHd2btbB/tys6pEFIW/xFzDn9rogVquX/kEH6mzMqZUnuBxTbcw4oPnvs9T/1hrfnFiJc=
ARC-Authentication-Results: i=2; server2.sourceware.org
X-CSE-ConnectionGUID: BJ+oeR0WRk2+Iu3W5q6fWQ==
X-CSE-MsgGUID: 7zQr1V1JSFih1+xbdKIjNA==
X-SBRS-Extended: Low
X-IronPortListener: ces-out
X-IronPort-AV: E=Sophos;i="6.06,185,1705381200"; d="scan'208";a="364086015"
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=SMc1mBS27D9fJKwoz9hjd9dFW9fWpuC4dOpxLYfFequ0/me4dZwRL6RqX0OaHn/oYxFaEKca56OLix6ePy1ThibJTPk4yUfFGvtyn8W5cqtN/a1jMXcPK+ufc6nm+UByu6QemsFP7AMb9bbEZgX5tEzVCxvpMFpq2obIEYSjU2uVvUzQ6DoQ1PocjYhB1XgPPipiTPLSYdWncshSoleOPrkCmEUJXDAflgLbb7gLLNDeFDUubcSaGUOM2J3M46ECdRebAL4v15O6w/X/VR8QXdWz60h0jjpM3eYXzUSPX6qtPC5pojx/XSKFod7G+onm73xvgzz7+5USBBmIUHOZ1A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=URajHiSugO3Zz/Zxet2cvGwnqDo4PVXoYm8u4LXge9s=;
b=lsL4/nsZ1LEljjezeEVmgfM2ULuKndzacj6dSAJz+qy7ayyzAO+y1cEelHksecdWl72wk2yIwPckqNdhuB7fhiqq+A/X/peR1/vK9QYqY4JZk2Y3fl8PHSE23rtslLtMu7UVFKuntRyx5R5Ofv0RqY7jZvEBEs2dNPj+vy4PmZfEI/8FHtt3D3EIcIirPQhUgjD491HUngMvfCSXm00xZ//1T0b2u17roWkbTjw0yqD0C9C2ZeGbKmluJojRSj27AMZgqJQFLripUfdqp7CP3w6m73ozC21JyCUBVfm7WgraXaGauG4+4CEC0rnF9GadB8r4kI0TYd7Rsu4lY0LaZQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=ncbi.nlm.nih.gov; dmarc=pass action=none
header.from=ncbi.nlm.nih.gov; dkim=pass header.d=ncbi.nlm.nih.gov; arc=none
To: "gs-cygwin DOT com AT gluelogic DOT com" <gs-cygwin DOT com AT gluelogic DOT com>,
Roland Mainz
<roland DOT mainz AT nrubsig DOT org>
CC: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: RE: [EXTERNAL] 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()| ?
Thread-Topic: [EXTERNAL] 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()| ?
Thread-Index: AQHaZ1NggkN+p9YFxEeTd4L0uiSEPbEbjcqAgAAYjgCAASdCMA==
Date: Mon, 26 Feb 2024 16:12:00 +0000
Deferred-Delivery: Mon, 26 Feb 2024 16:11:18 +0000
Message-ID: <DM8PR09MB70959E00897DFA39884CA61CA55A2@DM8PR09MB7095.namprd09.prod.outlook.com>
References: <CAKAoaQnFxij4Np-jg+bOLEpiSziCfamFrJ2FR_JeO+Sv_Td2Kg AT mail DOT gmail DOT com>
<ZdecXZNUgQ3i0hYN AT calimero DOT vinschen DOT de>
<CAKAoaQk39bKbG0a_sZAR2KKz5f4U04xc=499YibfbdLesxC4Vg AT mail DOT gmail DOT com>
<Zdo8B-IhG_dYAjGo AT calimero DOT vinschen DOT de>
<CAKAoaQmL4wQ526dQ_-ASHCMum8L2sKiR_LnP-ba+R+39ZCMKVw AT mail DOT gmail DOT com>
<Zdu_9j2OplMcA5ki AT xps13>
In-Reply-To: <Zdu_9j2OplMcA5ki@xps13>
Accept-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DM8PR09MB7095:EE_|CO6PR09MB8808:EE_
x-ms-office365-filtering-correlation-id: 417091ef-979e-47e3-f242-08dc36e5b538
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: EAE/szK9ga5SWsJLkXo7JxgYj9qt9b6uIx9Gin7q5hi09SWiwl7BjbP339sAL3Uqr79tw2LZGc1nGaMjp680GWop25jHbXWmmAgupUR2ALOIj8t6w0PWFM/6LHs19nTg5uRP41k4LUHMUgyi/79AJSuWfNDFQ4RrR+jX9Q4Z375EO7j8L4b49mjoGpmGaHWZScIDsyhrbiNfWTBFdut5O9MLjD8kg6Dmt10ju9Cei7Muckgv0FGtqY1FGoKZTbTV6G5RzrPe91LfBRj/IR4Z/SDzcrVyhPqiwyK4iBIupP2/cvyetLPLXNEmEz5G8fBwnf60GGAFuwo4cYL75Iw5QoROteHzw2OqyDu5dA74DIyzRdUGt8xo1iKydU3R5jY9vPCf1z9KVGdiyYo06uWFCqt6Ef/V0deJTIhj0kk/9wPQC/7iq/J9PMJqhysYP44CEiTOVYZm3ItX+oUP8cprXFjQc/7kzy/ONS6wMCFgJlviQRZLtNfBDlDp2oZRm+9acxegRSMkkuW4f06jxp5xwHFuiw4M0Wx2xdozRVvbYEwdCO73XOJlYPg92hFyAoOGEj8thOari7MTz0UaLLk2f01Emq8P+OFVn7xCLX6drlPWkgxzvQmyD366FcwwYg2Qd+OBeYXhjR8/hG51GH0HZqa8RkOsKnEIZ+UHFEkF+DPvNZEWzLIy0sn302QHcwmrf0hEWxFrcryk2EPv+6X9QKe5T8a6lMK46NbVMuCg1hI=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:DM8PR09MB7095.namprd09.prod.outlook.com; PTR:; CAT:NONE;
SFS:(13230031)(38070700009); DIR:OUT; SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?utf-8?B?bFE1UjlaeitSaHB6UUU0ajl4VWpTYkR3aHQyb3YwODlOSVNvY2d5VUFYNmRD?=
=?utf-8?B?R3Rhc3RRMGU4MlB4Wml4VTh4RFErdjN5UklXcitYMGRpWDVuQ0Q2OWxzSy9z?=
=?utf-8?B?ZTUwcExCZTNTQmxXNUN3Nm5pZ21TcGQwYTFrY0dyUWpaZnNkazFOdmhIZkN2?=
=?utf-8?B?U1lQdmY1VDhYd2UzTU50YjREM2JRRlpsTnlSZUYyR014bHJxUEJwdnk2ZHZj?=
=?utf-8?B?Z0JVNUx3SjZjWkpHT3l0emRxWDUwV20rSWJENzJuV1pKZk50M0NSWnVvaFY3?=
=?utf-8?B?QUpCYi96K2FGaUNjdEFkY1ZyMlBsSkhnSjNLS2MzMUE0Qyt2R1U1NzAwMWpt?=
=?utf-8?B?a2EzcmtwSDk0bmNTbDVhN2c1d0F4dnRVdEdQUGhyc0dpSjA1MDBUUkc2bENO?=
=?utf-8?B?b05CV2YvdW9FazRTNzhodWRNN280d3B1UUZYdDl4Ylc5amU1NEhsaTZQdUtK?=
=?utf-8?B?ZWZxdGhWQUdaL2NQT2hZeXlaMWZmSHl3ZVNLcG9BWGNsR2tOVTF2SThPZmJj?=
=?utf-8?B?QkRGY295UXNTOVFxQTBSVWtXdGpidEE4ZTZaVitnd3ZIenFjRGZhOEJaYUFo?=
=?utf-8?B?MzZaWlNYMlRBSW5mNStKMXpKYmhSMlpxRWlJNGF5aUFHa1FXdkMyVlFnNDBs?=
=?utf-8?B?RzZwbXh4ZDJGMTNCY2RHR01GQjVJc0lsb2pzR3RaRWpwTlhQTXcvbGp1SGx5?=
=?utf-8?B?eklkK3c3ZktNRXRybFlqc2pXeUMybU9TZEhwZ1RmSX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TWztZ6I/eIfNKjwkaoTWnuHwKeYEwh9KVzTUXdbplXEUpvwOSWk4Yusd/PrrWQ9m3mrJImqOu3Dj6uASl3ACEIIwL0L8PokKwj6jDTiRhV0bje/K/L2NLKnaQG1UahquvZTcjlo0XlFYVQ5lhIsqD893rmImsYjmgBNITOw85XGpNLxy5PD53KjmwnDPpIoPovVejYceJB2h3KNTIAJZMZpu4+P1dqzo02PGT1vkySr0E4dDat6mD90qH2L6az7JDhvzCAosQ5LIkHckHRj
X-OriginatorOrg: ncbi.nlm.nih.gov
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DM8PR09MB7095.namprd09.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 417091ef-979e-47e3-f242-08dc36e5b538
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Feb 2024 16:12:19.5431 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 14b77578-9773-42d5-8507-251ca2dc2b06
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR09MB8808
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_EF, RCVD_IN_MSPIKE_H2, SPF_PASS, TXREP,
T_SCC_BODY_TEXT_LINE,
T_SPF_HELO_PERMERROR autolearn=ham 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
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: "Lavrentiev, Anton \(NIH/NLM/NCBI\) \[C\] via Cygwin" <cygwin AT cygwin DOT com>
Reply-To: "Lavrentiev, Anton \(NIH/NLM/NCBI\) \[C\]" <lavr AT ncbi DOT nlm DOT nih DOT gov>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

> A robust solution which also reduces syscalls does not necessarily
> require a precise answer here.
> 
> I suggest writing a wrapper function which has on the stack
>   CSTR sidbuf[SECURITY_MAX_SID_SIZE];
> and calls LookupAccountNameA() passing sidbuf as Sid.
> If it succeeds, then malloc() returned cbSid value and copy sidbuf[].
> If it fails because the buffer is too small, then malloc() the returned
> cbSid value and call LookupAccountNameA() again.
> 
> Doing the above will keep memory use to a minimum, and will generally
> call LookupAccountNameA() once per wrapper func invocation rather than
> twice.

+1 !

Anton Lavrentiev
Contractor NIH/NLM/NCBI


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019