[dovecot-cvs] dovecot/src/login-common sasl-server.c,1.15,1.16
tss at dovecot.org
tss at dovecot.org
Fri Feb 16 13:40:51 UTC 2007
Update of /var/lib/cvs/dovecot/src/login-common
In directory talvi:/tmp/cvs-serv6374
Modified Files:
sasl-server.c
Log Message:
Make sure we crash if we're trying to call sasl_callback() too many times.
Index: sasl-server.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/login-common/sasl-server.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- sasl-server.c 6 Feb 2007 09:49:47 -0000 1.15
+++ sasl-server.c 16 Feb 2007 13:40:48 -0000 1.16
@@ -27,6 +27,7 @@
client->authenticating = FALSE;
client->sasl_callback(client, success ? SASL_SERVER_REPLY_SUCCESS :
SASL_SERVER_REPLY_MASTER_FAILED, NULL, NULL);
+ client->sasl_callback = NULL;
}
static void authenticate_callback(struct auth_request *request, int status,
@@ -71,6 +72,7 @@
client->authenticating = FALSE;
client->sasl_callback(client, SASL_SERVER_REPLY_SUCCESS,
NULL, args);
+ client->sasl_callback = NULL;
} else {
master_request_login(client, master_callback,
auth_client_request_get_server_pid(request),
@@ -94,6 +96,7 @@
client->authenticating = FALSE;
client->sasl_callback(client, SASL_SERVER_REPLY_AUTH_FAILED,
NULL, args);
+ client->sasl_callback = NULL;
break;
}
}
@@ -148,6 +151,8 @@
static void sasl_server_auth_cancel(struct client *client, const char *reason,
enum sasl_server_reply reply)
{
+ i_assert(client->authenticating);
+
if (verbose_auth && reason != NULL) {
const char *auth_name =
str_sanitize(client->auth_mech_name, MAX_MECH_NAME);
@@ -164,6 +169,7 @@
}
client->sasl_callback(client, reply, reason, NULL);
+ client->sasl_callback = NULL;
}
void sasl_server_auth_failed(struct client *client, const char *reason)
More information about the dovecot-cvs
mailing list