dovecot-2.0-pigeonhole: ManageSieve: fixed SASL negotiation; mec...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Fri Aug 6 17:17:38 EEST 2010


details:   http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/a73a01e2d6d2
changeset: 1359:a73a01e2d6d2
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Fri Aug 06 16:17:31 2010 +0200
description:
ManageSieve: fixed SASL negotiation; mechanisms that need a roundtrip were broken.

diffstat:

 src/managesieve-login/client-authenticate.c |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r cac6acdc4d0e -r a73a01e2d6d2 src/managesieve-login/client-authenticate.c
--- a/src/managesieve-login/client-authenticate.c	Wed Aug 04 18:19:59 2010 +0200
+++ b/src/managesieve-login/client-authenticate.c	Fri Aug 06 16:17:31 2010 +0200
@@ -145,6 +145,12 @@
 	const char *msg;
 	bool fatal;
 
+	if ( i_stream_read(client->input) == -1 ) {	
+		/* disconnected */
+		client_destroy(client, "Disconnected");
+		return -1;
+	}
+
 	if ( msieve_client->skip_line ) {
 		if ( i_stream_next_line(client->input) == NULL )
 			return 0;
@@ -159,15 +165,18 @@
 		if (fatal) {
 			/* FIXME: What to do? */
 		}
-	  
+
+		if ( i_stream_next_line(client->input) == NULL )
+			msieve_client->skip_line = TRUE;
 		sasl_server_auth_failed(client, msg);
 		return -1;
 	case -2:
 		/* not enough data */
 		return 0;
 	}
-
-	msieve_client->skip_line = TRUE;
+	
+	if ( i_stream_next_line(client->input) == NULL )
+		msieve_client->skip_line = TRUE;
 
 	if ( args[0].type != MANAGESIEVE_ARG_STRING || 
 		args[1].type != MANAGESIEVE_ARG_EOL ) {


More information about the dovecot-cvs mailing list