[dovecot-cvs] dovecot/src/imap-login client.h, 1.14, 1.15 imap-proxy.c, 1.4, 1.5

cras at dovecot.org cras at dovecot.org
Wed Oct 27 17:20:26 EEST 2004


Update of /var/lib/cvs/dovecot/src/imap-login
In directory talvi:/tmp/cvs-serv1759/imap-login

Modified Files:
	client.h imap-proxy.c 
Log Message:
Keep proxy_user stored until proxy is destroyed.



Index: client.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap-login/client.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- client.h	20 Oct 2004 14:02:12 -0000	1.14
+++ client.h	27 Oct 2004 14:20:24 -0000	1.15
@@ -25,6 +25,7 @@
 	const char *cmd_tag, *cmd_name;
 
 	unsigned int cmd_finished:1;
+	unsigned int proxy_login_sent:1;
 	unsigned int skip_line:1;
 	unsigned int input_blocked:1;
 	unsigned int destroyed:1;

Index: imap-proxy.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap-login/imap-proxy.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- imap-proxy.c	20 Oct 2004 14:02:12 -0000	1.4
+++ imap-proxy.c	27 Oct 2004 14:20:24 -0000	1.5
@@ -15,7 +15,7 @@
 {
 	string_t *str;
 
-	if (client->proxy_user != NULL) {
+	if (!client->proxy_login_sent) {
 		/* this is a banner */
 		if (strncmp(line, "* OK ", 5) != 0) {
 			i_error("imap-proxy(%s): "
@@ -36,10 +36,9 @@
 
 		safe_memset(client->proxy_password, 0,
 			    strlen(client->proxy_password));
-		i_free(client->proxy_user);
 		i_free(client->proxy_password);
-		client->proxy_user = NULL;
 		client->proxy_password = NULL;
+		client->proxy_login_sent = TRUE;
 		return 0;
 	} else if (strncmp(line, "P OK ", 5) == 0) {
 		/* Login successful. Send this line to client. */
@@ -71,6 +70,9 @@
 
 		login_proxy_free(client->proxy);
 		client->proxy = NULL;
+
+		i_free(client->proxy_user);
+		client->proxy_user = NULL;
 		return -1;
 	} else {
 		/* probably some untagged reply */
@@ -131,6 +133,7 @@
 	if (client->proxy == NULL)
 		return -1;
 
+	client->proxy_login_sent = FALSE;
 	client->proxy_user = i_strdup(user);
 	client->proxy_password = i_strdup(password);
 



More information about the dovecot-cvs mailing list