dovecot-1.2: *-login: SSL connections didn't get closed when the...

dovecot at dovecot.org dovecot at dovecot.org
Thu May 8 13:42:19 UTC 2014


details:   http://hg.dovecot.org/dovecot-1.2/rev/8ba4253adc9b
changeset: 9658:8ba4253adc9b
user:      Timo Sirainen <tss at iki.fi>
date:      Thu May 08 16:41:29 2014 +0300
description:
*-login: SSL connections didn't get closed when the client got destroyed.

diffstat:

 src/imap-login/client.c              |  2 ++
 src/login-common/ssl-proxy-openssl.c |  3 +--
 src/login-common/ssl-proxy.c         |  2 ++
 src/login-common/ssl-proxy.h         |  1 +
 src/pop3-login/client.c              |  2 ++
 5 files changed, 8 insertions(+), 2 deletions(-)

diffs (67 lines):

diff -r d6bd9acd97e7 -r 8ba4253adc9b src/imap-login/client.c
--- a/src/imap-login/client.c	Fri Oct 05 00:26:19 2012 +0300
+++ b/src/imap-login/client.c	Thu May 08 16:41:29 2014 +0300
@@ -557,6 +557,8 @@
 
 	client_unlink(&client->common);
 
+	if (!client->login_success && client->common.proxy != NULL)
+		ssl_proxy_destroy(client->common.proxy);
 	if (client->common.input != NULL)
 		i_stream_close(client->common.input);
 	if (client->output != NULL)
diff -r d6bd9acd97e7 -r 8ba4253adc9b src/login-common/ssl-proxy-openssl.c
--- a/src/login-common/ssl-proxy-openssl.c	Fri Oct 05 00:26:19 2012 +0300
+++ b/src/login-common/ssl-proxy-openssl.c	Thu May 08 16:41:29 2014 +0300
@@ -80,7 +80,6 @@
 static void ssl_read(struct ssl_proxy *proxy);
 static void ssl_write(struct ssl_proxy *proxy);
 static void ssl_step(struct ssl_proxy *proxy);
-static void ssl_proxy_destroy(struct ssl_proxy *proxy);
 static void ssl_proxy_unref(struct ssl_proxy *proxy);
 
 static void ssl_params_corrupted(const char *path)
@@ -676,7 +675,7 @@
 	main_unref();
 }
 
-static void ssl_proxy_destroy(struct ssl_proxy *proxy)
+void ssl_proxy_destroy(struct ssl_proxy *proxy)
 {
 	if (proxy->destroyed)
 		return;
diff -r d6bd9acd97e7 -r 8ba4253adc9b src/login-common/ssl-proxy.c
--- a/src/login-common/ssl-proxy.c	Fri Oct 05 00:26:19 2012 +0300
+++ b/src/login-common/ssl-proxy.c	Thu May 08 16:41:29 2014 +0300
@@ -55,6 +55,8 @@
 	return "";
 }
 
+void ssl_proxy_destroy(struct ssl_proxy *proxy ATTR_UNUSED) {}
+
 void ssl_proxy_free(struct ssl_proxy *proxy ATTR_UNUSED) {}
 
 unsigned int ssl_proxy_get_count(void)
diff -r d6bd9acd97e7 -r 8ba4253adc9b src/login-common/ssl-proxy.h
--- a/src/login-common/ssl-proxy.h	Fri Oct 05 00:26:19 2012 +0300
+++ b/src/login-common/ssl-proxy.h	Thu May 08 16:41:29 2014 +0300
@@ -24,6 +24,7 @@
 bool ssl_proxy_is_handshaked(const struct ssl_proxy *proxy) ATTR_PURE;
 const char *ssl_proxy_get_last_error(const struct ssl_proxy *proxy) ATTR_PURE;
 const char *ssl_proxy_get_security_string(struct ssl_proxy *proxy);
+void ssl_proxy_destroy(struct ssl_proxy *proxy);
 void ssl_proxy_free(struct ssl_proxy *proxy);
 
 /* Return number of active SSL proxies */
diff -r d6bd9acd97e7 -r 8ba4253adc9b src/pop3-login/client.c
--- a/src/pop3-login/client.c	Fri Oct 05 00:26:19 2012 +0300
+++ b/src/pop3-login/client.c	Thu May 08 16:41:29 2014 +0300
@@ -359,6 +359,8 @@
 
 	client_unlink(&client->common);
 
+	if (!client->login_success && client->common.proxy != NULL)
+		ssl_proxy_destroy(client->common.proxy);
 	if (client->common.input != NULL)
 		i_stream_close(client->common.input);
 	if (client->output != NULL)


More information about the dovecot-cvs mailing list