]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
If client disconnects without any auth attempts, don't log "auth failed".
authorTimo Sirainen <tss@iki.fi>
Mon, 25 Aug 2008 14:14:27 +0000 (17:14 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 25 Aug 2008 14:14:27 +0000 (17:14 +0300)
--HG--
branch : HEAD

src/imap-login/client.c
src/pop3-login/client.c

index f7be75a3ef9e45e5a93d85cd81cc0b0d583fe3b2..19e07ff67984922825bdab3f6561d85d4e833169 100644 (file)
@@ -547,8 +547,10 @@ void client_destroy(struct imap_client *client, const char *reason)
        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);
index d047a7a9b122dbcc0017d48ef55e93e4e87f3979..ec7980c75e4d8b48f57b8fd0e9f1599b44658057 100644 (file)
@@ -352,8 +352,10 @@ void client_destroy(struct pop3_client *client, const char *reason)
        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);