Re: [PATCH] cyrus-imapd: use getgrouplist instead of set/getgrent on systems supporting it

2007-09-17 Thread Tomas Janousek
Hi, On Mon, Sep 17, 2007 at 10:15:25AM -0400, Ken Murchison wrote: > Can you explain the use of: > > if (pwd || groupids[ngroups] != gid) Yes. It's linked to the line which reads: > gid = pwd ? pwd->pw_gid : (gid_t) -1; If pwd is non-NULL, we supply the gid and expect (and want) it to appear in

Re: [PATCH] cyrus-imapd: use getgrouplist instead of set/getgrent on systems supporting it

2007-09-17 Thread Ken Murchison
Tomas Janousek wrote: Hello, On Mon, Sep 17, 2007 at 09:49:38AM -0400, Ken Murchison wrote: I applied Simon's version to CVS, but then I realized that it causes myfreestate() to crash on my Linux box, because the newstate->groups array doesn't get entirely populated. The following patch fixes

Re: [PATCH] cyrus-imapd: use getgrouplist instead of set/getgrent on systems supporting it

2007-09-17 Thread Tomas Janousek
Hello, On Mon, Sep 17, 2007 at 09:49:38AM -0400, Ken Murchison wrote: > I applied Simon's version to CVS, but then I realized that it causes > myfreestate() to crash on my Linux box, because the newstate->groups array > doesn't get entirely populated. The following patch fixes the problem of

Re: [PATCH] cyrus-imapd: use getgrouplist instead of set/getgrent on systems supporting it

2007-09-17 Thread Ken Murchison
Tomas Janousek wrote: Hi Simon, On Tue, Jun 12, 2007 at 03:52:27PM +0200, Simon Matter wrote: I have slightly modified the patch to make older GCC happy with it. Does it still look okay? Yeah, it's fine, thanks. I applied Simon's version to CVS, but then I realized that it causes myfreesta

Re: [PATCH] cyrus-imapd: use getgrouplist instead of set/getgrent on systems supporting it

2007-06-12 Thread Tomas Janousek
Hi Simon, On Tue, Jun 12, 2007 at 03:52:27PM +0200, Simon Matter wrote: > I have slightly modified the patch to make older GCC happy with it. Does > it still look okay? Yeah, it's fine, thanks. -- Tomas Janousek, SW Engineer, Red Hat, Inc.

[PATCH] cyrus-imapd: use getgrouplist instead of set/getgrent on systems supporting it

2007-06-12 Thread Tomas Janousek
Hello, I'm attaching the fix for [rhbz#195501] (ported to cyrus-imapd 2.3). I think it might be worth applying. [rhbz#195501] https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=195501 The function getgrouplist is, as opposed to getgrent, cached by nscd. Simon Matter also dealt with this proble