Cyrus IMAPd 2.3.10 Released

Ken Murchison murch at andrew.cmu.edu
Fri Oct 26 10:16:11 EDT 2007


John Capo wrote:
> Quoting Ken Murchison (murch at andrew.cmu.edu):
>> John Capo wrote:
>>> On Thu, October 25, 2007 21:10, John Capo wrote:
>>>> Quoting Ken Murchison (murch at andrew.cmu.edu):
>>>>
>>>>> Simon Matter wrote:
>>>>>
>>>>>>> On the Linux box, all fresh compilations aside from the sasl 2.1.15 
>>>>>>> binaries:
>>>>>>>
>>>>>> I once posted to the list that 2.3.9 needs at least cyrus-sasl-2.1.19. 
>>>>>> As a package
>>>>>> maintainer I know that :)
>>>>> Did you ever figure out why?  I'm not surprised that code in Cyrus 
>>>>> somehow depends on
>>>>> a change in SASL, but I can't seem to find anything in the CVS logs or 
>>>>> diffs that
>>>>> would be the cause.
>>>> This is what I had to do for cmd_login to work in 2.3.9.
>>>>
>>>>
>>>> /* authstate already created by mysasl_proxy_policy() */
>>>> /* Not when using login and allowplaintext.  imapd_authstate is NULL  TM 
>>>> Login fix */
>>>> if (imapd_authstate == NULL)
>>>>    imapd_authstate = auth_newstate(imapd_userid);
>>>>
>>>> But 2.3.10 cores :-(
>>> Its coring in getgrouplist() probably because the 3rd argyument is NULL.
>>>
>>>    /* get number of groups user is member of into ngroups */
>>>    getgrouplist(identifier, gid, NULL, &ngroups);
>>>
>>> BSD man page does not indicate that NULL args are OK.
>>>
>>>  int
>>>  getgrouplist(const char *name, int basegid, int *groups, int *ngroups);
>>>
>>> The resulting group list is returned in the integer array pointed to by
>>> groups.  The caller specifies the size of the groups array in the integer
>>> pointed to by ngroups; the actual number of groups found is returned in
>>> ngroups.
>>
>> See if this fixes the getgrouplist() problem:
>>
> 
> It does fix the core dump.  Our IMAP users are not in any Unix group
> so I fully can't test that part.
> 
> 
>> --- auth_unix.c.~1.46.~	2007-09-27 16:02:45.000000000 -0400
>> +++ auth_unix.c	2007-10-25 23:02:15.000000000 -0400
>> @@ -225,7 +225,7 @@
>>      struct group *grp;
>>  #ifdef HAVE_GETGROUPLIST
>>      gid_t gid, *groupids = NULL;
>> -    int ret, ngroups = 0;
>> +    int ret, ngroups = 10;
>>  #else
>>      char **mem;
>>  #endif
>> @@ -248,10 +248,7 @@
>>  #ifdef HAVE_GETGROUPLIST
>>      gid = pwd ? pwd->pw_gid : (gid_t) -1;
>>
>> -    /* get number of groups user is member of into ngroups */
>> -    getgrouplist(identifier, gid, NULL, &ngroups);
>> -
>> -    /* get the actual group ids */
>> +    /* get the group ids */
>>      do {
>>  	groupids = (gid_t *)xrealloc((gid_t *)groupids,
>>  				     ngroups * sizeof(gid_t));

Thanks for the update.  Simon, since you're one of the original authors 
of the getgrouplist() stuff, can you check the sanity of my changes?

-- 
Kenneth Murchison
Systems Programmer
Project Cyrus Developer/Maintainer
Carnegie Mellon University


More information about the Info-cyrus mailing list