[dovecot-cvs] dovecot/src/imap-login client-authenticate.c, 1.39,
1.40
cras at dovecot.org
cras at dovecot.org
Mon Jun 5 23:25:42 EEST 2006
Update of /var/lib/cvs/dovecot/src/imap-login
In directory talvi:/tmp/cvs-serv13054/imap-login
Modified Files:
client-authenticate.c
Log Message:
IMAP: Reply with tagged BAD if authentication is aborted because client sent
"*" or something else that was a client error.
If authentication failed for any reason, the error message was always
"Authentication failed". In case of client errors or if auth process gave
an error message, it should have been that instead.
Index: client-authenticate.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap-login/client-authenticate.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- client-authenticate.c 28 Jan 2006 21:47:00 -0000 1.39
+++ client-authenticate.c 5 Jun 2006 20:25:40 -0000 1.40
@@ -63,16 +63,17 @@
return;
if (strcmp(line, "*") == 0) {
- sasl_server_auth_cancel(&client->common,
- "Authentication aborted");
+ sasl_server_auth_client_error(&client->common,
+ "Authentication aborted");
return;
}
if (client->common.auth_request == NULL) {
- sasl_server_auth_cancel(&client->common,
- "Don't send unrequested data");
+ sasl_server_auth_client_error(&client->common,
+ "Don't send unrequested data");
} else {
auth_client_request_continue(client->common.auth_request, line);
+ client->common.auth_request = NULL;
}
/* clear sensitive data */
@@ -178,6 +179,7 @@
{
struct imap_client *client = (struct imap_client *)_client;
struct const_iovec iov[3];
+ const char *msg;
size_t data_len;
switch (reply) {
@@ -191,12 +193,16 @@
client_destroy(client, "Login");
break;
case SASL_SERVER_REPLY_AUTH_FAILED:
+ case SASL_SERVER_REPLY_CLIENT_ERROR:
if (args != NULL) {
if (client_handle_args(client, args, TRUE))
break;
}
- client_send_tagline(client, "NO "AUTH_FAILED_MSG);
+ msg = reply == SASL_SERVER_REPLY_AUTH_FAILED ? "NO " : "BAD ";
+ msg = t_strconcat(msg, data != NULL ? data : AUTH_FAILED_MSG,
+ NULL);
+ client_send_tagline(client, msg);
/* get back to normal client input. */
if (client->io != NULL)
More information about the dovecot-cvs
mailing list