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

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 25 17:14:32 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/482d31bfef17
changeset: 7830:482d31bfef17
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 3d608cc2ae9d -r 482d31bfef17 src/imap-login/client.c
--- a/src/imap-login/client.c	Mon Aug 25 16:47:41 2008 +0300
+++ b/src/imap-login/client.c	Mon Aug 25 17:14:27 2008 +0300
@@ -485,8 +485,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 3d608cc2ae9d -r 482d31bfef17 src/pop3-login/client.c
--- a/src/pop3-login/client.c	Mon Aug 25 16:47:41 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