projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Nico Golde:
[apps/madmutt.git]
/
pop
/
pop_auth.c
diff --git
a/pop/pop_auth.c
b/pop/pop_auth.c
index
51cdeb0
..
7499816
100644
(file)
--- a/
pop/pop_auth.c
+++ b/
pop/pop_auth.c
@@
-16,6
+16,9
@@
#include "md5.h"
#include "pop.h"
#include "md5.h"
#include "pop.h"
+#include "lib/mem.h"
+#include "lib/intl.h"
+
#include <string.h>
#include <unistd.h>
#include <string.h>
#include <unistd.h>
@@
-235,7
+238,7
@@
static pop_auth_res_t pop_auth_user (POP_DATA * pop_data, const char *method)
char buf[LONG_STRING];
pop_query_status ret;
char buf[LONG_STRING];
pop_query_status ret;
- if (pop_data->cmd_user ==
USER
_NOT_AVAILABLE)
+ if (pop_data->cmd_user ==
CMD
_NOT_AVAILABLE)
return POP_A_UNAVAIL;
mutt_message _("Logging in...");
return POP_A_UNAVAIL;
mutt_message _("Logging in...");
@@
-243,15
+246,15
@@
static pop_auth_res_t pop_auth_user (POP_DATA * pop_data, const char *method)
snprintf (buf, sizeof (buf), "USER %s\r\n", pop_data->conn->account.user);
ret = pop_query (pop_data, buf, sizeof (buf));
snprintf (buf, sizeof (buf), "USER %s\r\n", pop_data->conn->account.user);
ret = pop_query (pop_data, buf, sizeof (buf));
- if (pop_data->cmd_user ==
USER
_UNKNOWN) {
+ if (pop_data->cmd_user ==
CMD
_UNKNOWN) {
if (ret == PQ_OK) {
if (ret == PQ_OK) {
- pop_data->cmd_user =
USER
_AVAILABLE;
+ pop_data->cmd_user =
CMD
_AVAILABLE;
dprint (1, (debugfile, "pop_auth_user: set USER capability\n"));
}
if (ret == PQ_ERR) {
dprint (1, (debugfile, "pop_auth_user: set USER capability\n"));
}
if (ret == PQ_ERR) {
- pop_data->cmd_user =
USER
_NOT_AVAILABLE;
+ pop_data->cmd_user =
CMD
_NOT_AVAILABLE;
dprint (1, (debugfile, "pop_auth_user: unset USER capability\n"));
snprintf (pop_data->err_msg, sizeof (pop_data->err_msg),
dprint (1, (debugfile, "pop_auth_user: unset USER capability\n"));
snprintf (pop_data->err_msg, sizeof (pop_data->err_msg),
@@
-298,7
+301,7
@@
static pop_auth_t pop_authenticators[] = {
* -2 - login failed,
* -3 - authentication canceled.
*/
* -2 - login failed,
* -3 - authentication canceled.
*/
-
int
pop_authenticate (POP_DATA * pop_data)
+
pop_query_status
pop_authenticate (POP_DATA * pop_data)
{
ACCOUNT *acct = &pop_data->conn->account;
pop_auth_t *authenticator;
{
ACCOUNT *acct = &pop_data->conn->account;
pop_auth_t *authenticator;
@@
-310,7
+313,7
@@
int pop_authenticate (POP_DATA * pop_data)
if (mutt_account_getuser (acct) || !acct->user[0] ||
mutt_account_getpass (acct) || !acct->pass[0])
if (mutt_account_getuser (acct) || !acct->user[0] ||
mutt_account_getpass (acct) || !acct->pass[0])
- return
-3
;
+ return
PFD_FUNCT_ERROR
;
if (PopAuthenticators && *PopAuthenticators) {
/* Try user-specified list of authentication methods */
if (PopAuthenticators && *PopAuthenticators) {
/* Try user-specified list of authentication methods */
@@
-330,12
+333,12
@@
int pop_authenticate (POP_DATA * pop_data)
ret = authenticator->authenticate (pop_data, method);
if (ret == POP_A_SOCKET)
switch (pop_connect (pop_data)) {
ret = authenticator->authenticate (pop_data, method);
if (ret == POP_A_SOCKET)
switch (pop_connect (pop_data)) {
- case
0
:
+ case
PQ_OK
:
{
ret = authenticator->authenticate (pop_data, method);
break;
}
{
ret = authenticator->authenticate (pop_data, method);
break;
}
- case
-2
:
+ case
PQ_ERR
:
ret = POP_A_FAILURE;
}
ret = POP_A_FAILURE;
}
@@
-365,13
+368,13
@@
int pop_authenticate (POP_DATA * pop_data)
ret = authenticator->authenticate (pop_data, authenticator->method);
if (ret == POP_A_SOCKET)
switch (pop_connect (pop_data)) {
ret = authenticator->authenticate (pop_data, authenticator->method);
if (ret == POP_A_SOCKET)
switch (pop_connect (pop_data)) {
- case
0
:
+ case
PQ_OK
:
{
ret =
authenticator->authenticate (pop_data, authenticator->method);
break;
}
{
ret =
authenticator->authenticate (pop_data, authenticator->method);
break;
}
- case
-2
:
+ case
PQ_ERR
:
ret = POP_A_FAILURE;
}
ret = POP_A_FAILURE;
}
@@
-387,13
+390,13
@@
int pop_authenticate (POP_DATA * pop_data)
switch (ret) {
case POP_A_SUCCESS:
switch (ret) {
case POP_A_SUCCESS:
- return
0
;
+ return
PQ_OK
;
case POP_A_SOCKET:
case POP_A_SOCKET:
- return
-1
;
+ return
PQ_NOT_CONNECTED
;
case POP_A_UNAVAIL:
if (!attempts)
mutt_error (_("No authenticators available"));
}
case POP_A_UNAVAIL:
if (!attempts)
mutt_error (_("No authenticators available"));
}
- return
-2
;
+ return
PQ_ERR
;
}
}