[dovecot-cvs] dovecot/src/auth userdb-passwd-file.c,1.25,1.26

tss at dovecot.org tss at dovecot.org
Wed Mar 14 16:42:21 EET 2007


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

Modified Files:
	userdb-passwd-file.c 
Log Message:
Reverted the last change, it was originally correct after all.



Index: userdb-passwd-file.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/userdb-passwd-file.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- userdb-passwd-file.c	14 Mar 2007 13:59:05 -0000	1.25
+++ userdb-passwd-file.c	14 Mar 2007 14:42:19 -0000	1.26
@@ -27,6 +27,8 @@
 		(struct passwd_file_userdb_module *)_module;
 	struct auth_stream_reply *reply;
 	struct passwd_user *pu;
+        const struct var_expand_table *table;
+	string_t *str;
 	const char *key, *value;
 	char **p;
 
@@ -46,14 +48,21 @@
 
 	if (pu->extra_fields != NULL) {
 		t_push();
+		str = t_str_new(512);
+		table = auth_request_get_var_expand_table(auth_request, NULL);
+
 		for (p = pu->extra_fields; *p != NULL; p++) {
 			if (strncmp(*p, "userdb_", 7) != 0)
 				continue;
 
 			key = *p + 7;
 			value = strchr(key, '=');
-			if (value != NULL)
-				key = t_strdup_until(key, value++);
+			if (value != NULL) {
+				key = t_strdup_until(key, value);
+				str_truncate(str, 0);
+				var_expand(str, value + 1, table);
+				value = str_c(str);
+			}
 			auth_stream_reply_add(reply, key, value);
 		}
 		t_pop();



More information about the dovecot-cvs mailing list