dovecot-1.1: auth: %m variable didn't work with blocking passdbs

dovecot at dovecot.org dovecot at dovecot.org
Wed Aug 27 10:13:35 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/3fcfe8d316b6
changeset: 7833:3fcfe8d316b6
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Aug 27 10:13:29 2008 +0300
description:
auth: %m variable didn't work with blocking passdbs

diffstat:

2 files changed, 9 insertions(+), 4 deletions(-)
src/auth/auth-request.c |   11 ++++++++---
src/auth/auth-request.h |    2 +-

diffs (54 lines):

diff -r 387f02ed98d6 -r 3fcfe8d316b6 src/auth/auth-request.c
--- a/src/auth/auth-request.c	Wed Aug 27 08:28:34 2008 +0300
+++ b/src/auth/auth-request.c	Wed Aug 27 10:13:29 2008 +0300
@@ -39,6 +39,7 @@ auth_request_new(struct auth *auth, cons
 
 	request->auth = auth;
 	request->mech = mech;
+	request->mech_name = mech == NULL ? NULL : mech->mech_name;
 	request->callback = callback;
 	request->context = context;
 	return request;
@@ -146,6 +147,8 @@ void auth_request_export(struct auth_req
 		auth_stream_reply_add(reply, "secured", "1");
 	if (request->skip_password_check)
 		auth_stream_reply_add(reply, "skip_password_check", "1");
+	if (request->mech_name != NULL)
+		auth_stream_reply_add(reply, "mech", request->mech_name);
 }
 
 bool auth_request_import(struct auth_request *request,
@@ -179,7 +182,9 @@ bool auth_request_import(struct auth_req
 	else if (strcmp(key, "skip_password_check") == 0) {
 		i_assert(request->master_user !=  NULL);
 		request->skip_password_check = TRUE;
-	} else
+	} else if (strcmp(key, "mech") == 0)
+		request->mech_name = p_strdup(request->pool, value);
+	else
 		return FALSE;
 
 	return TRUE;
@@ -1400,8 +1405,8 @@ auth_request_get_var_expand_table(const 
 		tab[9].value = auth_request->passdb == NULL ? "" :
 			dec2str(auth_request->passdb->id);
 	}
-	tab[10].value = auth_request->mech == NULL ? "" :
-		auth_request->mech->mech_name;
+	tab[10].value = auth_request->mech_name == NULL ? "" :
+		auth_request->mech_name;
 	tab[11].value = auth_request->secured ? "secured" : "";
 	tab[12].value = dec2str(auth_request->local_port);
 	tab[13].value = dec2str(auth_request->remote_port);
diff -r 387f02ed98d6 -r 3fcfe8d316b6 src/auth/auth-request.h
--- a/src/auth/auth-request.h	Wed Aug 27 08:28:34 2008 +0300
+++ b/src/auth/auth-request.h	Wed Aug 27 10:13:29 2008 +0300
@@ -62,7 +62,7 @@ struct auth_request {
 	unsigned int id;
 	time_t last_access;
 
-	const char *service;
+	const char *service, *mech_name;
 	struct ip_addr local_ip, remote_ip;
 	unsigned int local_port, remote_port;
 


More information about the dovecot-cvs mailing list