[dovecot-cvs] dovecot/src/auth auth-request.c,1.30,1.31

cras at dovecot.org cras at dovecot.org
Fri Oct 7 13:43:14 EEST 2005


Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv6748

Modified Files:
	auth-request.c 
Log Message:
We were caching failed blocking requests wrong.



Index: auth-request.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-request.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- auth-request.c	1 Oct 2005 10:52:14 -0000	1.30
+++ auth-request.c	7 Oct 2005 10:43:12 -0000	1.31
@@ -184,21 +184,24 @@
 		return;
 	}
 
+	if (request->passdb_password == NULL) {
+		/* save to cache only if we know the password */
+		return;
+	}
+
 	/* save all except the currently given password in cache */
 	str = t_str_new(256);
-	if (request->passdb_password != NULL) {
-		if (*request->passdb_password != '{') {
-			/* cached passwords must have a known scheme */
-			str_append_c(str, '{');
-			str_append(str, passdb->default_pass_scheme);
-			str_append_c(str, '}');
-		}
-		if (strchr(request->passdb_password, '\t') != NULL)
-			i_panic("%s: Password contains TAB", request->user);
-		if (strchr(request->passdb_password, '\n') != NULL)
-			i_panic("%s: Password contains LF", request->user);
-		str_append(str, request->passdb_password);
+	if (*request->passdb_password != '{') {
+		/* cached passwords must have a known scheme */
+		str_append_c(str, '{');
+		str_append(str, passdb->default_pass_scheme);
+		str_append_c(str, '}');
 	}
+	if (strchr(request->passdb_password, '\t') != NULL)
+		i_panic("%s: Password contains TAB", request->user);
+	if (strchr(request->passdb_password, '\n') != NULL)
+		i_panic("%s: Password contains LF", request->user);
+	str_append(str, request->passdb_password);
 
 	if (extra_fields != NULL) {
 		str_append_c(str, '\t');



More information about the dovecot-cvs mailing list