[dovecot-cvs] dovecot/src/auth auth-request.c, 1.24, 1.25 passdb-cache.c, 1.10, 1.11

cras at dovecot.org cras at dovecot.org
Wed Jun 15 11:05:07 EEST 2005


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

Modified Files:
	auth-request.c passdb-cache.c 
Log Message:
Auth cache wasn't working if password wasn't given (ie. didn't work for
proxying).



Index: auth-request.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-request.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- auth-request.c	14 Jun 2005 10:29:01 -0000	1.24
+++ auth-request.c	15 Jun 2005 08:05:04 -0000	1.25
@@ -170,21 +170,18 @@
 		return;
 	}
 
-	if (request->passdb_password == NULL) {
-		/* no password given by passdb, cannot cache this */
-		return;
-	}
-
 	/* save all except the currently given password in cache */
 	str = t_str_new(32 + (request->extra_fields != NULL ? 
 			      str_len(request->extra_fields) : 0));
-	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 (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, '}');
+		}
+		str_append(str, request->passdb_password);
 	}
-	str_append(str, request->passdb_password);
 
 	if (request->extra_fields != NULL) {
 		str_append_c(str, '\t');

Index: passdb-cache.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-cache.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- passdb-cache.c	8 Apr 2005 10:28:40 -0000	1.10
+++ passdb-cache.c	15 Jun 2005 08:05:04 -0000	1.11
@@ -54,13 +54,18 @@
 	}
 
 	list = t_strsplit(value, "\t");
+        list_save(request, list + 1);
+
 	cached_pw = list[0];
+	if (*cached_pw == '\0') {
+		/* NULL password */
+		*result_r = PASSDB_RESULT_OK;
+		return TRUE;
+	}
 
 	scheme = password_get_scheme(&cached_pw);
 	i_assert(scheme != NULL);
 
-        list_save(request, list + 1);
-
 	ret = password_verify(password, cached_pw, scheme, request->user);
 	if (ret < 0) {
 		auth_request_log_error(request, "cache",



More information about the dovecot-cvs mailing list