dovecot-2.2: imap/pop3-login: If LOGIN/USER is used with plainte...

dovecot at dovecot.org dovecot at dovecot.org
Wed Oct 14 14:29:52 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/06908dbcee62
changeset: 19305:06908dbcee62
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Oct 14 17:28:11 2015 +0300
description:
imap/pop3-login: If LOGIN/USER is used with plaintext auth disabled, remember the username for logging.
It's still useful to see the username that was sent in the logout message.
This won't work for AUTHENTICATE PLAIN, but hopefully the clients that use
it understand the LOGINDISABLED capability better.

diffstat:

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

diffs (32 lines):

diff -r 8f7a0201ebe3 -r 06908dbcee62 src/imap-login/client-authenticate.c
--- a/src/imap-login/client-authenticate.c	Wed Oct 14 14:06:35 2015 +0300
+++ b/src/imap-login/client-authenticate.c	Wed Oct 14 17:28:11 2015 +0300
@@ -180,8 +180,11 @@
 	    !IMAP_ARG_IS_EOL(&args[2]))
 		return -1;
 
-	if (!client_check_plaintext_auth(client, TRUE))
+	if (!client_check_plaintext_auth(client, TRUE)) {
+		if (client->virtual_user == NULL)
+			client->virtual_user = i_strdup(user);
 		return 1;
+	}
 
 	/* authorization ID \0 authentication ID \0 pass */
 	plain_login = buffer_create_dynamic(pool_datastack_create(), 64);
diff -r 8f7a0201ebe3 -r 06908dbcee62 src/pop3-login/client-authenticate.c
--- a/src/pop3-login/client-authenticate.c	Wed Oct 14 14:06:35 2015 +0300
+++ b/src/pop3-login/client-authenticate.c	Wed Oct 14 17:28:11 2015 +0300
@@ -108,8 +108,11 @@
 
 bool cmd_user(struct pop3_client *pop3_client, const char *args)
 {
-	if (!client_check_plaintext_auth(&pop3_client->common, FALSE))
+	if (!client_check_plaintext_auth(&pop3_client->common, FALSE)) {
+		if (pop3_client->common.virtual_user == NULL)
+			pop3_client->common.virtual_user = i_strdup(args);
 		return TRUE;
+	}
 
 	i_free(pop3_client->last_user);
 	pop3_client->last_user = i_strdup(args);


More information about the dovecot-cvs mailing list