Rocco Rutte:
authorpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Wed, 7 Sep 2005 17:47:48 +0000 (17:47 +0000)
committerpdmef <pdmef@e385b8ad-14ed-0310-8656-cc95a2468c6d>
Wed, 7 Sep 2005 17:47:48 +0000 (17:47 +0000)
- fix SASL 1.x removal

git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@484 e385b8ad-14ed-0310-8656-cc95a2468c6d

VERSION.svn
configure.in
imap/auth_sasl.c
mutt_sasl.c
mutt_sasl.h

index 1448fd8..f52aaac 100644 (file)
@@ -1 +1 @@
-483
+484
index c0981e0..42dff96 100644 (file)
@@ -651,7 +651,7 @@ AC_ARG_WITH(sasl2, AC_HELP_STRING([--with-sasl2[=PFX]], [Use Cyrus SASL library
           MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_sasl.o"
           MUTTLIBS="$MUTTLIBS -lsasl2"
           LIBS="$saved_LIBS"
           MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_sasl.o"
           MUTTLIBS="$MUTTLIBS -lsasl2"
           LIBS="$saved_LIBS"
-          AC_DEFINE(USE_SASL2,1,
+          AC_DEFINE(USE_SASL,1,
                   [ Define if want to use version 2 of the Cyrus SASL library. ])
           need_sasl=yes
         fi
                   [ Define if want to use version 2 of the Cyrus SASL library. ])
           need_sasl=yes
         fi
index 88001d4..71b8f49 100644 (file)
 #include "lib/intl.h"
 #include "lib/debug.h"
 
 #include "lib/intl.h"
 #include "lib/debug.h"
 
-#ifdef USE_SASL
 #include <sasl/sasl.h>
 #include <sasl/saslutil.h>
 #include <sasl/sasl.h>
 #include <sasl/saslutil.h>
-#endif
 
 /* imap_auth_sasl: Default authenticator if available. */
 imap_auth_res_t imap_auth_sasl (IMAP_DATA * idata, const char *method)
 
 /* imap_auth_sasl: Default authenticator if available. */
 imap_auth_res_t imap_auth_sasl (IMAP_DATA * idata, const char *method)
@@ -37,9 +35,7 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA * idata, const char *method)
   char buf[HUGE_STRING];
   const char *mech;
 
   char buf[HUGE_STRING];
   const char *mech;
 
-#ifdef USE_SASL
   const char *pc = NULL;
   const char *pc = NULL;
-#endif
   unsigned int len, olen;
   unsigned char client_start;
 
   unsigned int len, olen;
   unsigned char client_start;
 
@@ -65,18 +61,14 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA * idata, const char *method)
     if (mutt_bit_isset (idata->capabilities, AUTH_ANON) &&
         (!idata->conn->account.user[0] ||
          !ascii_strncmp (idata->conn->account.user, "anonymous", 9)))
     if (mutt_bit_isset (idata->capabilities, AUTH_ANON) &&
         (!idata->conn->account.user[0] ||
          !ascii_strncmp (idata->conn->account.user, "anonymous", 9)))
-#ifdef USE_SASL
       rc = sasl_client_start (saslconn, "AUTH=ANONYMOUS", NULL, &pc, &olen,
                               &mech);
       rc = sasl_client_start (saslconn, "AUTH=ANONYMOUS", NULL, &pc, &olen,
                               &mech);
-#endif
   }
 
   if (rc != SASL_OK && rc != SASL_CONTINUE)
     do {
   }
 
   if (rc != SASL_OK && rc != SASL_CONTINUE)
     do {
-#ifdef USE_SASL
       rc = sasl_client_start (saslconn, method, &interaction,
                               &pc, &olen, &mech);
       rc = sasl_client_start (saslconn, method, &interaction,
                               &pc, &olen, &mech);
-#endif
       if (rc == SASL_INTERACT)
         mutt_sasl_interact (interaction);
     }
       if (rc == SASL_INTERACT)
         mutt_sasl_interact (interaction);
     }
@@ -116,11 +108,9 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA * idata, const char *method)
       goto bail;
 
     if (irc == IMAP_CMD_RESPOND) {
       goto bail;
 
     if (irc == IMAP_CMD_RESPOND) {
-#ifdef USE_SASL
       if (sasl_decode64
           (idata->cmd.buf + 2, str_len (idata->cmd.buf + 2), buf,
            LONG_STRING - 1,
       if (sasl_decode64
           (idata->cmd.buf + 2, str_len (idata->cmd.buf + 2), buf,
            LONG_STRING - 1,
-#endif
                          &len) != SASL_OK) {
         debug_print (1, ("error base64-decoding server response.\n"));
         goto bail;
                          &len) != SASL_OK) {
         debug_print (1, ("error base64-decoding server response.\n"));
         goto bail;
@@ -150,9 +140,7 @@ imap_auth_res_t imap_auth_sasl (IMAP_DATA * idata, const char *method)
 
       /* sasl_client_st(art|ep) allocate pc with malloc, expect me to 
        * free it */
 
       /* sasl_client_st(art|ep) allocate pc with malloc, expect me to 
        * free it */
-#ifndef USE_SASL
       mem_free (&pc);
       mem_free (&pc);
-#endif
     }
 
     if (irc == IMAP_CMD_RESPOND) {
     }
 
     if (irc == IMAP_CMD_RESPOND) {
index c93413d..94783ae 100644 (file)
@@ -69,7 +69,6 @@ static int getnameinfo_err (int ret)
   }
   return err;
 }
   }
   return err;
 }
-#endif
 
 /* arbitrary. SASL will probably use a smaller buffer anyway. OTOH it's
  * been a while since I've had access to an SASL server which negotiated
 
 /* arbitrary. SASL will probably use a smaller buffer anyway. OTOH it's
  * been a while since I've had access to an SASL server which negotiated
@@ -123,7 +122,6 @@ static int iptostring (const struct sockaddr *addr, socklen_t addrlen,
 
   return SASL_OK;
 }
 
   return SASL_OK;
 }
-#endif
 
 /* mutt_sasl_start: called before doing a SASL exchange - initialises library
  *   (if necessary). */
 
 /* mutt_sasl_start: called before doing a SASL exchange - initialises library
  *   (if necessary). */
index b61eda3..ca69bb8 100644 (file)
@@ -12,9 +12,7 @@
 #ifndef _MUTT_SASL_H_
 #define _MUTT_SASL_H_ 1
 
 #ifndef _MUTT_SASL_H_
 #define _MUTT_SASL_H_ 1
 
-#ifdef USE_SASL
 #include <sasl/sasl.h>
 #include <sasl/sasl.h>
-#endif
 
 #include "mutt_socket.h"
 
 
 #include "mutt_socket.h"