This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: FW: mkgroup (366): [2123] The API return buffer is too small.
- From: Christopher Faylor <cgf-use-the-mailinglist-please at cygwin dot com>
- To: Cygwin patches <cygwin-patches at cygwin dot com>
- Date: Thu, 30 Aug 2007 20:16:41 -0400
- Subject: Re: FW: mkgroup (366): [2123] The API return buffer is too small.
- References: <007b01c7eb25$0e8716c0$2e08a8c0@CAM.ARTIMI.COM>
- Reply-to: cygwin-patches at cygwin dot com
On Thu, Aug 30, 2007 at 05:44:39PM +0100, Dave Korn wrote:
>On 30 August 2007 01:35, Brian Egge wrote:
>
>> When running mkgroup after installing cygwin I receive the following
>> error:
>>
>> $ mkgroup -l -d > /etc/group
>> mkgroup (366): [2123] The API return buffer is too small.
>>
>> I suspect this is due to the large number of groups our organization
>> has.
>
> Very strange. All the other netenum* calls use MAX_PREFERRED_LENGTH. Can't
>see why this one would be omitted, but the fix is basically obvious.
>
> Tested by turning down the size to 128 so I could reproduce the error on my
>system here, then using MAX_PREFERRED_LENGTH and watching it no longer fail.
>
>
>winsup/utils/ChangeLog:
>
> * mkgroup.c (enum_groups): Use MAX_PREFERRED_LENGTH in netgroupenum
> call so that it will automatically size returned buffer sufficiently.
Looks good to me. Please check it in, Dave.
Thanks for the patch.
cgf