The bug was reported 2 months ago[1], I think this patch is ok.

[1]http://code.google.com/p/cherokee/issues/detail?id=464

On Mon, Jul 27, 2009 at 3:45 AM, Stuart Henderson<st...@openbsd.org> wrote:
> On 2009/07/24 23:55, Matthias Kilian wrote:
>> On Fri, Jul 24, 2009 at 11:32:59PM +0200, Matthias Kilian wrote:
>> > The portable way would be to enlarge the buffer and retry whenever
>> > you get ERANGE. I ran into this problem several weeks ago for GHC
>> > (and a diff doing the try/enlarge/retry-game had been accepted
>> > upstream). IIRC, there even was some #ifdef'ing around that already
>> > increased the buffer especially for OpenBSD,
>>
>> To clarify, read: increased the *statically sized buffer* especially
>> for OpenBSD.
>>
>> From libraries/unix/System/Posix/Unix.hsc (as in ghc-6.10):
>>
>> #if defined(HAVE_SYSCONF) && defined(HAVE_SC_GETGR_R_SIZE_MAX)
>> grBufSize = sysconfWithDefault 2048 (#const _SC_GETGR_R_SIZE_MAX)
>> #else
>> grBufSize = 2048        -- just assume some value (1024 is too small on
>> OpenBSD)
>> #endif
>>
>> Anyway, on an OS without any limit on possible group members, no
>> constant value nor any value returned by sysconf(3) is guaranteed
>> to be large enough for getgrnam_r(3).
>
> I think upstream should probably implement something like that,
> but setting to a static 8k is good enough to unbreak the port on
> all OpenBSD arch, so unless there are objections I'll commit
> that this evening.
>
>



-- 
--------------

Fernando Quintero
http://nonroot.blogspot.com/
*Just a nonroot User*

Reply via email to