dovecot-1.2: If client disconnects without any auth attempts, do...

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 25 17:17:13 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/16cb3a2b25ab
changeset: 8106:16cb3a2b25ab
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 25 17:14:27 2008 +0300
description:
If client disconnects without any auth attempts, don't log "auth failed".

diffstat:

2 files changed, 8 insertions(+), 4 deletions(-)
src/imap-login/client.c |    6 ++++--
src/pop3-login/client.c |    6 ++++--

diffs (32 lines):

diff -r ad9ad222729c -r 16cb3a2b25ab src/imap-login/client.c
--- a/src/imap-login/client.c	Mon Aug 25 16:47:22 2008 +0300
+++ b/src/imap-login/client.c	Mon Aug 25 17:14:27 2008 +0300
@@ -547,8 +547,10 @@ void client_destroy(struct imap_client *
 	client->destroyed = TRUE;
 
 	if (!client->login_success && reason != NULL) {
-		reason = t_strdup_printf("%s (auth failed, %u attempts)",
-					 reason, client->common.auth_attempts);
+		reason = client->common.auth_attempts == 0 ?
+			t_strdup_printf("%s (no auth attempts)", reason) :
+			t_strdup_printf("%s (auth failed, %u attempts)",
+					reason, client->common.auth_attempts);
 	}
 	if (reason != NULL)
 		client_syslog(&client->common, reason);
diff -r ad9ad222729c -r 16cb3a2b25ab src/pop3-login/client.c
--- a/src/pop3-login/client.c	Mon Aug 25 16:47:22 2008 +0300
+++ b/src/pop3-login/client.c	Mon Aug 25 17:14:27 2008 +0300
@@ -352,8 +352,10 @@ void client_destroy(struct pop3_client *
 	client->destroyed = TRUE;
 
 	if (!client->login_success && reason != NULL) {
-		reason = t_strdup_printf("%s (auth failed, %u attempts)",
-					 reason, client->common.auth_attempts);
+		reason = client->common.auth_attempts == 0 ?
+			t_strdup_printf("%s (no auth attempts)", reason) :
+			t_strdup_printf("%s (auth failed, %u attempts)",
+					reason, client->common.auth_attempts);
 	}
 	if (reason != NULL)
 		client_syslog(&client->common, reason);


More information about the dovecot-cvs mailing list