[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] GNU Mailutils branch, master, updated. release-2.2-658-g3f63391
From: |
Sergey Poznyakoff |
Subject: |
[SCM] GNU Mailutils branch, master, updated. release-2.2-658-g3f63391 |
Date: |
Wed, 17 Jul 2013 08:17:09 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".
http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=3f63391c6ddb872bd6cb78662a24c5adade4a59c
The branch, master has been updated
via 3f63391c6ddb872bd6cb78662a24c5adade4a59c (commit)
from 27051677165ddc320ad3283f4b4563e51a3ece74 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3f63391c6ddb872bd6cb78662a24c5adade4a59c
Author: Sergey Poznyakoff <address@hidden>
Date: Wed Jul 17 11:11:42 2013 +0300
Support for RFC 3206
* pop3d/pop3d.h (ERR_SYS_LOGIN): New error code.
* pop3d/capa.c (pop3d_session_init): Advertise the AUTH-RESP-CODE
capability.
* pop3d/cmd.c (error_table) <ERR_BAD_LOGIN>: Mark with the
AUTH response code.
<ERR_SYS_LOGIN>: New entry.
* pop3d/user.c (pop3d_user): Use mu_get_auth to obtain
the user's identity. On error, the error code is ERR_BAD_LOGIN
or ERR_SYS_LOGIN, depending on its return and return from
mu_authenticate.
-----------------------------------------------------------------------
Summary of changes:
pop3d/capa.c | 1 +
pop3d/cmd.c | 3 ++-
pop3d/pop3d.h | 1 +
pop3d/user.c | 22 ++++++++++++++++++----
4 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/pop3d/capa.c b/pop3d/capa.c
index 5832c45..161e1a5 100644
--- a/pop3d/capa.c
+++ b/pop3d/capa.c
@@ -137,6 +137,7 @@ pop3d_session_init (struct pop3d_session *session)
pop3d_append_capa_string (session, "UIDL", NULL);
pop3d_append_capa_string (session, "RESP-CODES", NULL);
pop3d_append_capa_string (session, "PIPELINING", NULL);
+ pop3d_append_capa_string (session, "AUTH-RESP-CODE", NULL);
if (pop3d_xlines)
pop3d_append_capa_string (session, "XLINES", NULL);
diff --git a/pop3d/cmd.c b/pop3d/cmd.c
index 2389a87..358aafd 100644
--- a/pop3d/cmd.c
+++ b/pop3d/cmd.c
@@ -71,7 +71,7 @@ struct error_table
static struct error_table error_table[] = {
{ ERR_WRONG_STATE, "Incorrect state" },
{ ERR_BAD_ARGS, "Invalid arguments" },
- { ERR_BAD_LOGIN, "Bad login" },
+ { ERR_BAD_LOGIN, "[AUTH] Bad login" },
{ ERR_NO_MESG, "No such message" },
{ ERR_MESG_DELE, "Message has been deleted" },
{ ERR_NOT_IMPL, "Not implemented" },
@@ -95,6 +95,7 @@ static struct error_table error_table[] = {
{ ERR_LOGIN_DELAY,
"[LOGIN-DELAY] Attempt to log in within the minimum login delay interval"
},
{ ERR_TERMINATE, "Terminating on request" },
+ { ERR_SYS_LOGIN, "[SYS/PERM] Cannot authenticate" },
{ 0 }
};
diff --git a/pop3d/pop3d.h b/pop3d/pop3d.h
index c30086e..f61a33c 100644
--- a/pop3d/pop3d.h
+++ b/pop3d/pop3d.h
@@ -167,6 +167,7 @@ extern int expire_on_exit;
#define ERR_TLS_IO 21
#define ERR_LOGIN_DELAY 22
#define ERR_TERMINATE 23
+#define ERR_SYS_LOGIN 24
enum tls_mode
{
diff --git a/pop3d/user.c b/pop3d/user.c
index 6706ac9..9eb3e04 100644
--- a/pop3d/user.c
+++ b/pop3d/user.c
@@ -107,23 +107,37 @@ pop3d_user (char *arg, struct pop3d_session *sess)
}
#endif
- auth_data = mu_get_auth_by_name (arg);
-
- if (auth_data == NULL)
+ rc = mu_get_auth (&auth_data, mu_auth_key_name, arg);
+ switch (rc)
{
+ case 0:
+ break;
+ case MU_ERR_AUTH_FAILURE:
+ case MU_ERR_NOENT:
mu_diag_output (MU_DIAG_INFO, _("user `%s' nonexistent"), arg);
return ERR_BAD_LOGIN;
+ default:
+ mu_error (_("error getting identity info for user `%s': %s"),
+ arg, mu_strerror (rc));
+ return ERR_SYS_LOGIN;
}
rc = mu_authenticate (auth_data, pass);
openlog (MU_LOG_TAG (), LOG_PID, mu_log_facility);
- if (rc)
+ switch (rc)
{
+ case 0:
+ break;
+ case MU_ERR_AUTH_FAILURE:
mu_diag_output (MU_DIAG_INFO,
_("user `%s': authentication failed"), arg);
mu_auth_data_destroy (&auth_data);
return ERR_BAD_LOGIN;
+ default:
+ mu_error (_("error authenticating user `%s': %s"),
+ arg, mu_strerror (rc));
+ return ERR_SYS_LOGIN;
}
}
else if (mu_c_strcasecmp (cmd, "QUIT") == 0)
hooks/post-receive
--
GNU Mailutils
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] GNU Mailutils branch, master, updated. release-2.2-658-g3f63391,
Sergey Poznyakoff <=