[dovecot-cvs] dovecot/src/auth auth-request.c,1.58.2.19,1.58.2.20

tss at dovecot.org tss at dovecot.org
Wed Jan 24 16:37:44 UTC 2007


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

Modified Files:
      Tag: branch_1_0
	auth-request.c 
Log Message:
If auth_cache was enabled and userdb returned "user unknown" (typically only
deliver can do that), we crashed.



Index: auth-request.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-request.c,v
retrieving revision 1.58.2.19
retrieving revision 1.58.2.20
diff -u -d -r1.58.2.19 -r1.58.2.20
--- auth-request.c	19 Jan 2007 15:25:31 -0000	1.58.2.19
+++ auth-request.c	24 Jan 2007 16:37:41 -0000	1.58.2.20
@@ -548,9 +548,10 @@
 	if (passdb_cache == NULL || userdb->cache_key == NULL)
 		return;
 
-	str = auth_stream_reply_export(reply);
-	auth_cache_insert(passdb_cache, request, userdb->cache_key, str,
-			  result == PASSDB_RESULT_OK);
+	str = result == USERDB_RESULT_USER_UNKNOWN ? "" :
+		auth_stream_reply_export(reply);
+	/* last_success has no meaning with userdb */
+	auth_cache_insert(passdb_cache, request, userdb->cache_key, str, FALSE);
 }
 
 static bool auth_request_lookup_user_cache(struct auth_request *request,



More information about the dovecot-cvs mailing list