[dovecot-cvs] dovecot/src/pop3-login client-authenticate.c, 1.49.2.2, 1.49.2.3 client.c, 1.50.2.6, 1.50.2.7 pop3-proxy.c, 1.10.2.2, 1.10.2.3

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


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

Modified Files:
      Tag: branch_1_0
	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.49.2.2
retrieving revision 1.49.2.3
diff -u -d -r1.49.2.2 -r1.49.2.3
--- client-authenticate.c	5 Jun 2006 20:25:14 -0000	1.49.2.2
+++ client-authenticate.c	7 Nov 2006 15:06:18 -0000	1.49.2.3
@@ -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.50.2.6
retrieving revision 1.50.2.7
diff -u -d -r1.50.2.6 -r1.50.2.7
--- client.c	13 Oct 2006 23:52:02 -0000	1.50.2.6
+++ client.c	7 Nov 2006 15:06:18 -0000	1.50.2.7
@@ -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.10.2.2
retrieving revision 1.10.2.3
diff -u -d -r1.10.2.2 -r1.10.2.3
--- pop3-proxy.c	13 Oct 2006 23:11:04 -0000	1.10.2.2
+++ pop3-proxy.c	7 Nov 2006 15:06:18 -0000	1.10.2.3
@@ -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