As far as I know, this change has already been
made in the latest vpopmail development version.
The development version is stable enough to be
used in production systems.

Ken Jones
inter7.com

On Sunday 14 July 2002 06:49 am, Vlad Soutyrine wrote:
> Brian,
>
> I had the same problem authenticating with authvchkpw module.  If you
> use other authenticating module, this letter will not help.
>
> I also submitted a question like this to the group a couple weeks ago
> and Sam replied that there is an unknown bug in vpopmail which conflicts
> with courier-imap.
>
> I've just found this bug today.
>
> In file vpopmail.c, function parse_email puts terminating zero into
> string user one symbol behind the right place.  If the buffer for string
> user is zeroed before calling function parse_email, this bug is hidden -
> this is apparently why this bug does not bother vpopmail itself.
> However, in courier-imap's file authlib/preauthvchkpw.c, function
> auth_vchkpw_pre calls parse_email without cleaning the buffer for
> variable user first.  So, right after restart, when static buffer is
> zeroed, it works for a while until you try to authenticate different
> user with a shorter username.  The user with the longest username always
> works fine.
>
> To fix it, replace piece of code from vpopmail.c
> =========================================
>     for( i=0,j=0,found=0; found==0 && j<buff_size && email[i]!=0;
> ++i,++j) {
>         for(k=0;ATCHARS[k]!=0;++k){
>             if ( email[i] == ATCHARS[k] ) {
>                 found = 1;
>                 continue;
>             }
>         }
>         if ( found == 0 )  {
>           user[j] = email[i];
>         }
>     }
>     user[j] = 0;
> =========================================
> with this code
> =========================================
>     for( i=0,j=0,found=0; found==0 && j<buff_size && email[i]!=0; ++i) {
>         for(k=0;ATCHARS[k]!=0;++k){
>             if ( email[i] == ATCHARS[k] ) {
>                 found = 1;
>                 break;
>             }
>         }
>         if ( found == 0 )  {
>           user[j++] = email[i];
>         }
>     }
>     user[j] = 0;
> =========================================
>
> Here is a patch that you may apply to vpopmail.c
> =========================================
> 1019c1019
> <     for( i=0,j=0,found=0; found==0 && j<buff_size && email[i]!=0;
> ++i,++j) {
> ---
>
> >     for( i=0,j=0,found=0; found==0 && j<buff_size && email[i]!=0; ++i)
>
> {
> 1027c1027
> <           user[j] = email[i];
> ---
>
> >           user[j++] = email[i];
>
> =========================================
>
> The change is so small (only two lines are affected), that you will
> probably do it faster by manual editing, instead of patching.
>
> You will have to recompile and reinstall vpopmail after making this
> change, this will create new vpopmail library, then recompile and
> reinstall courier-imap which will pick up new vpopmail library code for
> static linking.
>
> After I've done this on my computer, it all works smoothly and
> flawlessly since that.
>
> Best,
> Vlad
>
> -----Original Message-----
> From: Brian Keifer [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 12, 2002 9:55 AM
> To: [EMAIL PROTECTED]
> Subject: [courier-users] Authentication problem
>
> Hi, all.
>
> We're having a bit of an issue with courier-imap, and from some of the
> web searches I've done, it looks like this list is familiar with the
> problems.  Courier-imap will run fine for a while, but after some time
> (there doesn't seem to be any pattern to speak of) it stops allowing
> users to authenticate.  I've seen fingers pointed at libexec/imapd.rc
> and authdaemon, but nothing conclusive.
>
> The logs don't show anything that looks like a good place to start
> debugging, other than the following four lines in the maillog for each
> attempt.
>
> Jul 12 12:49:49 mail01 imapd: Connection, ip=[::ffff:###.###.###.###]
> Jul 12 12:49:54 mail01 imapd: LOGIN FAILED, ip=[::ffff:###.###.###.###]
> Jul 12 12:50:04 mail01 last message repeated 2 times
> Jul 12 12:50:04 mail01 imapd: LOGOUT, ip=[::ffff:###.###.###.###]
>
> If I restart courier-imap, things are back to normal and logins succeed.
>  Can you folks recommend a starting point, perhaps getting courier to
> give some more descriptive logging info?  Or, if this is something
> you've seen before, what were the past resolutions?
>
> System configuration:
> FreeBSD 4.5
> qmail-1.03
> courier-imap-1.4.4
> vpopmail-5.2
>
> Thanks in advance!
>
> -Brian
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Gadgets, caffeine, t-shirts, fun stuff.
> http://thinkgeek.com/sf
> _______________________________________________
> courier-users mailing list
> [EMAIL PROTECTED]
> Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to