Re: [PATCH] Use getgrouplist where available.

2008-02-24 Thread Jim Meyering
Mike Frysinger <[EMAIL PROTECTED]> wrote: > On Saturday 23 February 2008, Jim Meyering wrote: >> Mike Frysinger <[EMAIL PROTECTED]> wrote: >> > On Saturday 23 February 2008, Jim Meyering wrote: >> >> Jim Meyering <[EMAIL PROTECTED]> wrote: >> >> > But I suspect your point is that I need to check fo

Re: [PATCH] Use getgrouplist where available.

2008-02-23 Thread Mike Frysinger
On Saturday 23 February 2008, Jim Meyering wrote: > Mike Frysinger <[EMAIL PROTECTED]> wrote: > > On Saturday 23 February 2008, Jim Meyering wrote: > >> Jim Meyering <[EMAIL PROTECTED]> wrote: > >> > But I suspect your point is that I need to check for overflow. > >> > That's true. I'm adding this

Re: [PATCH] Use getgrouplist where available.

2008-02-23 Thread Jim Meyering
Mike Frysinger <[EMAIL PROTECTED]> wrote: > On Saturday 23 February 2008, Jim Meyering wrote: >> Jim Meyering <[EMAIL PROTECTED]> wrote: >> > But I suspect your point is that I need to check for overflow. >> > That's true. I'm adding this: >> > >> > diff --git a/gl/lib/mgetgroups.c b/gl/lib/mgetgr

Re: [PATCH] Use getgrouplist where available.

2008-02-23 Thread Mike Frysinger
On Saturday 23 February 2008, Jim Meyering wrote: > Jim Meyering <[EMAIL PROTECTED]> wrote: > > But I suspect your point is that I need to check for overflow. > > That's true. I'm adding this: > > > > diff --git a/gl/lib/mgetgroups.c b/gl/lib/mgetgroups.c > > index 317cc7c..ba8818e 100644 > > Than

Re: [PATCH] Use getgrouplist where available.

2008-02-23 Thread Jim Meyering
Jim Meyering <[EMAIL PROTECTED]> wrote: > But I suspect your point is that I need to check for overflow. > That's true. I'm adding this: > > diff --git a/gl/lib/mgetgroups.c b/gl/lib/mgetgroups.c > index 317cc7c..ba8818e 100644 Thanks again. I've pushed the result: id: avoid race when a group is

Re: [PATCH] Use getgrouplist where available.

2008-02-22 Thread James Youngman
(I have moved the discussion to the gnulib mailing list; bug-coreutils is BCC'ed) On Fri, Feb 22, 2008 at 9:27 AM, Jim Meyering <[EMAIL PROTECTED]> wrote: > No. I note your subsequent mail, and yes, I was indeed thinking about oversized allocations. > This function is intended to be usable from

Re: [PATCH] Use getgrouplist where available.

2008-02-22 Thread Jim Meyering
Jim Meyering <[EMAIL PROTECTED]> wrote: > "James Youngman" <[EMAIL PROTECTED]> wrote: >> On Fri, Feb 22, 2008 at 9:04 AM, Jim Meyering <[EMAIL PROTECTED]> wrote: > ... >>> + h = realloc (g, max_n_groups * sizeof *h); >> >> Shouldn't realloc here be xnrealloc? > > No. This function is int

Re: [PATCH] Use getgrouplist where available.

2008-02-22 Thread Jim Meyering
"James Youngman" <[EMAIL PROTECTED]> wrote: > On Fri, Feb 22, 2008 at 9:04 AM, Jim Meyering <[EMAIL PROTECTED]> wrote: ... >> + h = realloc (g, max_n_groups * sizeof *h); > > Shouldn't realloc here be xnrealloc? No. This function is intended to be usable from a library. I.e., no fair cal

Re: [PATCH] Use getgrouplist where available.

2008-02-22 Thread James Youngman
On Fri, Feb 22, 2008 at 9:04 AM, Jim Meyering <[EMAIL PROTECTED]> wrote: > + while (1) > + { > + GETGROUPS_T *h; > + ng = getgrouplist (username, gid, g, &max_n_groups); > + if (0 <= ng) > + { > + *groups = g; > + return

Re: [PATCH] Use getgrouplist where available.

2008-02-22 Thread Jim Meyering
James Youngman <[EMAIL PROTECTED]> wrote: > 2008-02-18 James Youngman <[EMAIL PROTECTED]> > > * gl/m4/mgetgroups.m4: Check for getgrouplist. > * gl/lib/mgetgroups.c (mgetgroups): Use getgrouplist, if > available. > * TODO: Remove the item about switching to getgrouplist. .