Scott Russell wrote:
> 
> Ken -
> 
> The patch you supplied 'fixed' it. (I'm not sure why not being a C coder
> myself). Does this patch actually fix the problem or does it back out a
> change that was added going from 2.0.13 to 2.0.14?

It should fix the problem.  Basically, imapd processes are now reused
(they used to service one client connection and then exit), which
requires some reset() code to reinitialize per-connection info.  Because
of SASL v1.5 inconsistent memory management (the upcoming v2 is MUCH
better), the space that imapd_userid points to was being freed twice
(only when clients used the AUTHENTICATE command).  I simply made a
second copy of the userid instead of having two pointers to the same
memory location.

> Side note, the patch didn't apply cleanly. Hunk2 failed even after I fixed
> the line wrap damage. In the end vi was my friend.

Hmm.  Not sure why.  I made the patch against the current CVS, and
nothing in cmd_authenticate() has changed since 2.0.14.

> Lastly, this works in my RH6.2 environment now. I don't have the time this
> week to go back to a RH7.1 environment so I don't know how it will react
> there.

It should work the same.

Ken


> On Thu, Jul 05, 2001 at 03:10:22PM -0400, Ken Murchison wrote:
> >
> > Scott,
> >
> > Please try this patch.
> >
> > Ken
> >
> > Index: imapd.c
> > ===================================================================
> > RCS file: /afs/andrew/system/cvs/src/cyrus/imap/imapd.c,v
> > retrieving revision 1.308
> > diff -c -r1.308 imapd.c
> > *** imapd.c     2001/06/23 03:14:02     1.308
> > --- imapd.c     2001/07/05 19:09:03
> > ***************
> > *** 1526,1531 ****
> > --- 1526,1533 ----
> >       int *ssfp;
> >       char *ssfmsg=NULL;
> >
> > +     char *canon_user;
> > +
> >       sasl_result = sasl_server_start(imapd_saslconn, authtype,
> >                                     NULL, 0,
> >                                     &serverout, &serveroutlen,
> > ***************
> > *** 1589,1595 ****
> >        * mysasl_authproc()
> >        */
> >       sasl_result = sasl_getprop(imapd_saslconn, SASL_USERNAME,
> > !                              (void **) &imapd_userid);
> >       if (sasl_result != SASL_OK) {
> >         prot_printf(imapd_out, "%s NO weird SASL error %d
> > SASL_USERNAME\r\n",
> >                     tag, sasl_result);
> > --- 1591,1598 ----
> >        * mysasl_authproc()
> >        */
> >       sasl_result = sasl_getprop(imapd_saslconn, SASL_USERNAME,
> > !                              (void **) &canon_user);
> > !     imapd_userid = xstrdup(canon_user);
> >       if (sasl_result != SASL_OK) {
> >         prot_printf(imapd_out, "%s NO weird SASL error %d
> > SASL_USERNAME\r\n",
> >                     tag, sasl_result);
> >
> > --
> > Kenneth Murchison     Oceana Matrix Ltd.
> > Software Engineer     21 Princeton Place
> > 716-662-8973 x26      Orchard Park, NY 14127
> > --PGP Public Key--    http://www.oceana.com/~ken/ksm.pgp
> 
> --
> Regards,
>  Scott Russell ([EMAIL PROTECTED])
>  Linux Technology Center, System Admin, RHCE.
>  T/L 441-9289 / External 919-543-9289
>  http://bzimage.raleigh.ibm.com/webcam

-- 
Kenneth Murchison     Oceana Matrix Ltd.
Software Engineer     21 Princeton Place
716-662-8973 x26      Orchard Park, NY 14127
--PGP Public Key--    http://www.oceana.com/~ken/ksm.pgp

Reply via email to