dovecot-2.1: passdb vpopmail: Always prefer to lookup plaintext ...

dovecot at dovecot.org dovecot at dovecot.org
Sun Oct 2 20:17:41 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/423cf2ccd1f1
changeset: 13598:423cf2ccd1f1
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Oct 02 20:26:02 2011 +0300
description:
passdb vpopmail: Always prefer to lookup plaintext password if it exists.
This is important when multiple auth mechanisms are used and the password is
cached.

diffstat:

 src/auth/passdb-vpopmail.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 341174c093ee -r 423cf2ccd1f1 src/auth/passdb-vpopmail.c
--- a/src/auth/passdb-vpopmail.c	Sun Oct 02 20:09:04 2011 +0300
+++ b/src/auth/passdb-vpopmail.c	Sun Oct 02 20:26:02 2011 +0300
@@ -75,8 +75,12 @@
 		password = NULL;
 		*result_r = PASSDB_RESULT_USER_DISABLED;
 	} else {
-		password = t_strdup_noconst(cleartext ? vpw->pw_clear_passwd :
-					   vpw->pw_passwd);
+		if (vpw->pw_clear_passwd != NULL)
+			password = t_strdup_noconst(vpw->pw_clear_passwd);
+		else if (!cleartext)
+			password = t_strdup_noconst(vpw->pw_passwd);
+		else
+			password = NULL;
 		*result_r = password != NULL ? PASSDB_RESULT_OK :
 			PASSDB_RESULT_SCHEME_NOT_AVAILABLE;
 	}


More information about the dovecot-cvs mailing list