X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0	tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY
X-Spam-Check-By: sourceware.org
Message-ID: <4F9EC085.8070602@t-online.de>
Date: Mon, 30 Apr 2012 18:40:37 +0200
From: Christian Franke <Christian.Franke@t-online.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120312 Firefox/11.0 SeaMonkey/2.8
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: how to drop administrator privileges?
References: <878vhiz0zw.fsf@Rainer.invalid> <4F99BF0F.9050807@cwilson.fastmail.fm> <8762cl67ym.fsf@Rainer.invalid> <loom.20120427T093249-85@post.gmane.org> <20120427082014.GL25385@calimero.vinschen.de>
In-Reply-To: <20120427082014.GL25385@calimero.vinschen.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Corinna Vinschen wrote:
> Fixing cygdrop.
>
>    $ net helpmsg 122
>    The data area passed to a system call is too small.
>
> A quick look into the sources shows that the maximum buffer size for
> the group list returned by GetTokenInformation is wrongly computed:
>
>    max_groups = 100;
>    char groups_buf[sizeof(DWORD) + max_groups * sizeof(SID_AND_ATTRIBUTES)];
>
> The SID_AND_ATTRIBUTES structure only contains a pointer to the SID, so
> what's missing is actual space for the SIDs.

Oops.

> But it would be better to leave that to the OS anyway:

Thanks for the patch. Works as expected.

Christian


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

