libESMTP AUTH patch



Hi folks,

I just discovered a bug in libESMTP causing an infinite loop with the
SMTP server when SMTP AUTH fails.

Here is a patch which fixes it.

Regards,
Brian Stafford

*** ../libesmtp-0.7.2/smtp-auth.c       Wed May  2 14:02:35 2001
--- ./smtp-auth.c       Fri May 25 14:31:35 2001
***************
*** 104,109 ****
--- 104,119 ----
    return 0;
  }
  
+ static int
+ next_auth_mechanism (smtp_session_t session)
+ {
+   while ((session->current_mechanism =
session->current_mechanism->next) != NULL)
+     if (auth_set_mechanism (session->auth_context,
+                           session->current_mechanism->name))
+       return 1;
+   return 0;
+ }
+ 
  void
  cmd_auth (siobuf_t conn, smtp_session_t session)
  {
***************
*** 147,153 ****
          /* If another mechanism cannot be selected, move on to the
             mail command since the MTA is required to accept mail for
             its own domain. */
!         if (select_auth_mechanism (session))
            session->rsp_state = S_auth;
          else
            session->rsp_state = S_mail;
--- 157,163 ----
          /* If another mechanism cannot be selected, move on to the
             mail command since the MTA is required to accept mail for
             its own domain. */
!         if (next_auth_mechanism (session))
            session->rsp_state = S_auth;
          else
            session->rsp_state = S_mail;




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]