projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new lua implementation.
[apps/madmutt.git]
/
pop
/
pop_auth.c
diff --git
a/pop/pop_auth.c
b/pop/pop_auth.c
index
eb575bf
..
04c1e39
100644
(file)
--- a/
pop/pop_auth.c
+++ b/
pop/pop_auth.c
@@
-7,24
+7,14
@@
* please see the file GPL in the top level source directory.
*/
* please see the file GPL in the top level source directory.
*/
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
+#include <lib-lib/lib-lib.h>
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/macros.h>
#include <lib-hash/hash.h>
#include <lib-hash/hash.h>
-#include <lib-
lib/debug
.h>
+#include <lib-
mx/mx
.h>
#include "mutt.h"
#include "mutt.h"
-#include "mx.h"
#include "pop.h"
#include "pop.h"
-
-#include <string.h>
-#include <unistd.h>
-
#ifdef USE_SASL
#include <sasl/sasl.h>
#include <sasl/saslutil.h>
#ifdef USE_SASL
#include <sasl/sasl.h>
#include <sasl/saslutil.h>
@@
-49,7
+39,6
@@
static pop_auth_res_t pop_auth_sasl (POP_DATA * pop_data, const char *method)
unsigned char client_start;
if (mutt_sasl_client_new (pop_data->conn, &saslconn) < 0) {
unsigned char client_start;
if (mutt_sasl_client_new (pop_data->conn, &saslconn) < 0) {
- debug_print (1, ("Error allocating SASL connection.\n"));
return POP_A_FAILURE;
}
return POP_A_FAILURE;
}
@@
-67,8
+56,6
@@
static pop_auth_res_t pop_auth_sasl (POP_DATA * pop_data, const char *method)
}
if (rc != SASL_OK && rc != SASL_CONTINUE) {
}
if (rc != SASL_OK && rc != SASL_CONTINUE) {
- debug_print (1, ("Failure starting authentication exchange. No shared mechanisms?\n"));
-
/* SASL doesn't support suggested mechanisms, so fall back */
return POP_A_UNAVAIL;
}
/* SASL doesn't support suggested mechanisms, so fall back */
return POP_A_UNAVAIL;
}
@@
-99,7
+86,6
@@
static pop_auth_res_t pop_auth_sasl (POP_DATA * pop_data, const char *method)
&len) != SASL_OK)
#endif
{
&len) != SASL_OK)
#endif
{
- debug_print (1, ("error base64-decoding server response.\n"));
goto bail;
}
goto bail;
}
@@
-119,7
+105,6
@@
static pop_auth_res_t pop_auth_sasl (POP_DATA * pop_data, const char *method)
/* send out response, or line break if none needed */
if (pc) {
if (sasl_encode64 (pc, olen, buf, sizeof (buf), &olen) != SASL_OK) {
/* send out response, or line break if none needed */
if (pc) {
if (sasl_encode64 (pc, olen, buf, sizeof (buf), &olen) != SASL_OK) {
- debug_print (1, ("error base64-encoding client response.\n"));
goto bail;
}
goto bail;
}
@@
-235,14
+220,11
@@
static pop_auth_res_t pop_auth_user (POP_DATA * pop_data,
if (pop_data->cmd_user == CMD_UNKNOWN) {
if (ret == PQ_OK) {
pop_data->cmd_user = CMD_AVAILABLE;
if (pop_data->cmd_user == CMD_UNKNOWN) {
if (ret == PQ_OK) {
pop_data->cmd_user = CMD_AVAILABLE;
-
- debug_print (1, ("set USER capability\n"));
}
if (ret == PQ_ERR) {
pop_data->cmd_user = CMD_NOT_AVAILABLE;
}
if (ret == PQ_ERR) {
pop_data->cmd_user = CMD_NOT_AVAILABLE;
- debug_print (1, ("unset USER capability\n"));
snprintf (pop_data->err_msg, sizeof (pop_data->err_msg),
_("Command USER is not supported by server."));
}
snprintf (pop_data->err_msg, sizeof (pop_data->err_msg),
_("Command USER is not supported by server."));
}
@@
-250,12
+232,7
@@
static pop_auth_res_t pop_auth_user (POP_DATA * pop_data,
if (ret == PQ_OK) {
snprintf (buf, sizeof (buf), "PASS %s\r\n", pop_data->conn->account.pass);
if (ret == PQ_OK) {
snprintf (buf, sizeof (buf), "PASS %s\r\n", pop_data->conn->account.pass);
- ret = pop_query_d (pop_data, buf, sizeof (buf),
-#ifdef DEBUG
- /* don't print the password unless we're at the ungodly debugging level */
- DebugLevel < M_SOCK_LOG_FULL ? "PASS *\r\n" :
-#endif
- NULL);
+ ret = pop_query (pop_data, buf, sizeof (buf));
}
switch (ret) {
}
switch (ret) {
@@
-314,7
+291,6
@@
pop_query_status pop_authenticate (POP_DATA * pop_data)
comma = strchr (method, ':');
if (comma)
*comma++ = '\0';
comma = strchr (method, ':');
if (comma)
*comma++ = '\0';
- debug_print (2, ("Trying method %s\n", method));
authenticator = pop_authenticators;
while (authenticator->authenticate) {
authenticator = pop_authenticators;
while (authenticator->authenticate) {
@@
-350,7
+326,6
@@
pop_query_status pop_authenticate (POP_DATA * pop_data)
}
else {
/* Fall back to default: any authenticator */
}
else {
/* Fall back to default: any authenticator */
- debug_print (2, ("Using any available method.\n"));
authenticator = pop_authenticators;
while (authenticator->authenticate) {
authenticator = pop_authenticators;
while (authenticator->authenticate) {