This should make them visible in more clients.
--HG--
branch : HEAD
if (line == NULL)
return;
- if (strcmp(line, "*") == 0) {
- sasl_server_auth_client_error(&client->common,
- "Authentication aborted");
- } else {
+ if (strcmp(line, "*") == 0)
+ sasl_server_auth_abort(&client->common);
+ else {
client_set_auth_waiting(client);
auth_client_request_continue(client->common.auth_request, line);
io_remove(&client->io);
allowed to log in. Shouldn't probably happen. */
reply = t_str_new(128);
if (reason != NULL)
- str_printfa(reply, "NO %s", reason);
+ str_printfa(reply, "NO [ALERT] %s", reason);
else if (temp) {
str_append(reply, "NO ["IMAP_RESP_CODE_UNAVAILABLE"] "
AUTH_TEMP_FAILED_MSG);
bool nodelay;
i_assert(!client->destroyed ||
- reply == SASL_SERVER_REPLY_CLIENT_ERROR ||
+ reply == SASL_SERVER_REPLY_AUTH_ABORTED ||
reply == SASL_SERVER_REPLY_MASTER_FAILED);
switch (reply) {
client_destroy_success(client, "Login");
break;
case SASL_SERVER_REPLY_AUTH_FAILED:
- case SASL_SERVER_REPLY_CLIENT_ERROR:
+ case SASL_SERVER_REPLY_AUTH_ABORTED:
if (client->to_auth_waiting != NULL)
timeout_remove(&client->to_auth_waiting);
if (args != NULL) {
break;
}
- msg = reply == SASL_SERVER_REPLY_AUTH_FAILED ? "NO " : "BAD ";
- msg = t_strconcat(msg, data != NULL ? data :
- IMAP_AUTH_FAILED_MSG, NULL);
+ if (reply == SASL_SERVER_REPLY_AUTH_ABORTED)
+ msg = "BAD Authentication aborted by client.";
+ else if (data == NULL)
+ msg = "NO "IMAP_AUTH_FAILED_MSG;
+ else
+ msg = t_strconcat("NO [ALERT] ", data, NULL);
client_send_tagline(client, msg);
if (!client->destroyed)
client->common.master_tag);
} else if (client->common.auth_request != NULL) {
i_assert(client->common.authenticating);
- sasl_server_auth_client_error(&client->common, NULL);
+ sasl_server_auth_abort(&client->common);
} else {
i_assert(!client->common.authenticating);
}
sasl_server_auth_cancel(client, reason, SASL_SERVER_REPLY_AUTH_FAILED);
}
-void sasl_server_auth_client_error(struct client *client, const char *reason)
+void sasl_server_auth_abort(struct client *client)
{
- sasl_server_auth_cancel(client, reason, SASL_SERVER_REPLY_CLIENT_ERROR);
+ sasl_server_auth_cancel(client, NULL, SASL_SERVER_REPLY_AUTH_ABORTED);
}
enum sasl_server_reply {
SASL_SERVER_REPLY_SUCCESS,
SASL_SERVER_REPLY_AUTH_FAILED,
- SASL_SERVER_REPLY_CLIENT_ERROR,
+ SASL_SERVER_REPLY_AUTH_ABORTED,
SASL_SERVER_REPLY_MASTER_FAILED,
SASL_SERVER_REPLY_CONTINUE
};
const char *initial_resp_base64,
sasl_server_callback_t *callback);
void sasl_server_auth_failed(struct client *client, const char *reason);
-void sasl_server_auth_client_error(struct client *client, const char *reason);
+void sasl_server_auth_abort(struct client *client);
#endif
if (line == NULL)
return;
- if (strcmp(line, "*") == 0) {
- sasl_server_auth_client_error(&client->common,
- "Authentication aborted");
- } else {
+ if (strcmp(line, "*") == 0)
+ sasl_server_auth_abort(&client->common);
+ else {
auth_client_request_continue(client->common.auth_request, line);
io_remove(&client->io);
bool nodelay;
i_assert(!client->destroyed ||
- reply == SASL_SERVER_REPLY_CLIENT_ERROR ||
+ reply == SASL_SERVER_REPLY_AUTH_ABORTED ||
reply == SASL_SERVER_REPLY_MASTER_FAILED);
switch (reply) {
client_destroy_success(client, "Login");
break;
case SASL_SERVER_REPLY_AUTH_FAILED:
- case SASL_SERVER_REPLY_CLIENT_ERROR:
+ case SASL_SERVER_REPLY_AUTH_ABORTED:
if (args != NULL) {
if (client_handle_args(client, args, FALSE, &nodelay))
break;
}
- msg = t_strconcat("-ERR ", data != NULL ?
- data : AUTH_FAILED_MSG, NULL);
+ if (reply == SASL_SERVER_REPLY_AUTH_ABORTED)
+ msg = "-ERR Authentication aborted by client.";
+ else if (data == NULL)
+ msg = "-ERR "AUTH_FAILED_MSG;
+ else
+ msg = t_strconcat("-ERR ", data, NULL);
client_send_line(client, msg);
if (!client->destroyed)
client->common.master_tag);
} else if (client->common.auth_request != NULL) {
i_assert(client->common.authenticating);
- sasl_server_auth_client_error(&client->common, NULL);
+ sasl_server_auth_abort(&client->common);
} else {
i_assert(!client->common.authenticating);
}