[dovecot-cvs] dovecot/src/pop3-login client-authenticate.c, 1.51, 1.52 client.c, 1.56, 1.57 pop3-proxy.c, 1.12, 1.13

tss at dovecot.org tss at dovecot.org
Tue Nov 7 15:06:28 UTC 2006


Update of /var/lib/cvs/dovecot/src/pop3-login
In directory talvi:/tmp/cvs-serv19167/pop3-login

Modified Files:
	client-authenticate.c client.c pop3-proxy.c 
Log Message:
Crashfixes and more asserts. Mostly related to use of AUTHENTICATE/AUTH
commands.



Index: client-authenticate.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3-login/client-authenticate.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- client-authenticate.c	5 Jun 2006 20:25:40 -0000	1.51
+++ client-authenticate.c	7 Nov 2006 15:06:25 -0000	1.52
@@ -75,12 +75,12 @@
 		return;
 	}
 
-	if (client->common.auth_request == NULL) {
+	if (client->common.waiting_auth_reply) {
 		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;
+		client->common.waiting_auth_reply = TRUE;
 	}
 
 	/* clear sensitive data */
@@ -156,6 +156,8 @@
 	const char *msg;
 	size_t data_len;
 
+	i_assert(!client->destroyed || reply == SASL_SERVER_REPLY_CLIENT_ERROR);
+
 	switch (reply) {
 	case SASL_SERVER_REPLY_SUCCESS:
 		if (args != NULL) {

Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3-login/client.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- client.c	13 Oct 2006 23:52:05 -0000	1.56
+++ client.c	7 Nov 2006 15:06:26 -0000	1.57
@@ -360,8 +360,10 @@
 		o_stream_close(client->output);
 
 	if (client->common.auth_request != NULL) {
-		auth_client_request_abort(client->common.auth_request);
-                client->common.auth_request = NULL;
+		i_assert(client->common.authenticating);
+		sasl_server_auth_client_error(&client->common, NULL);
+	} else {
+		i_assert(!client->common.authenticating);
 	}
 
 	if (client->common.master_tag != 0)

Index: pop3-proxy.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3-login/pop3-proxy.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- pop3-proxy.c	13 Oct 2006 23:11:07 -0000	1.12
+++ pop3-proxy.c	7 Nov 2006 15:06:26 -0000	1.13
@@ -17,6 +17,8 @@
 	string_t *str;
 	const char *line;
 
+	i_assert(!client->destroyed);
+
 	if (input == NULL) {
 		if (client->io != NULL) {
 			/* remote authentication failed, we're just
@@ -138,6 +140,7 @@
 		   unsigned int port, const char *user, const char *password)
 {
 	i_assert(user != NULL);
+	i_assert(!client->destroyed);
 
 	if (password == NULL) {
 		i_error("proxy(%s): password not given",
@@ -148,6 +151,12 @@
 	i_assert(client->refcount > 1);
 	connection_queue_add(1);
 
+	if (client->destroyed) {
+		/* connection_queue_add() decided that we were the oldest
+		   connection and killed us. */
+		return -1;
+	}
+
 	client_ref(client);
 	client->proxy = login_proxy_new(&client->common, host, port,
 					proxy_input, client);



More information about the dovecot-cvs mailing list