Re: [Toybox] [PATCH] bufgetgrgid: fix for very large groups.

2018-07-02 Thread Rob Landley
On 07/02/2018 01:13 PM, enh wrote: >> These twio functions irritate me because it's the same code with trivially >> different data types. It's even using the same structure offsets and putting >> the >> same stuff on the stack, just using a different static list pointer and >> calling >> a

Re: [Toybox] [PATCH] bufgetgrgid: fix for very large groups.

2018-07-02 Thread enh
On Sat, Jun 30, 2018 at 10:12 PM Rob Landley wrote: > > On 06/30/2018 09:45 PM, Rob Landley wrote: > > Sigh, but I might as well keep the two functions matching in case I do work > > out > > a way to collapse them together later. > > Question, which requires some context first: > > I've been

Re: [Toybox] [PATCH] bufgetgrgid: fix for very large groups.

2018-07-02 Thread enh
On Sat, Jun 30, 2018 at 7:45 PM Rob Landley wrote: > > On 06/28/2018 06:41 PM, enh wrote: > > In theory, both getpwuid_r and getgrgid_r need to loop until the buffer > > is large enough. In practice, that's true for me with getgrgid_r. > > A fixed size 512 byte allocation is pretty small. It

Re: [Toybox] [PATCH] bufgetgrgid: fix for very large groups.

2018-06-30 Thread Rob Landley
On 06/30/2018 09:45 PM, Rob Landley wrote: > Sigh, but I might as well keep the two functions matching in case I do work > out > a way to collapse them together later. Question, which requires some context first: I've been triaging pending/ and looking at the 4 groupadd/groupdel/useradd/userdel

Re: [Toybox] [PATCH] bufgetgrgid: fix for very large groups.

2018-06-30 Thread Rob Landley
On 06/28/2018 06:41 PM, enh wrote: > In theory, both getpwuid_r and getgrgid_r need to loop until the buffer > is large enough. In practice, that's true for me with getgrgid_r. A fixed size 512 byte allocation is pretty small. It should probably have been page size, but since the list never