[dovecot-cvs] dovecot/src/auth userdb-passwd-file.c, 1.22.2.3, 1.22.2.4

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


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

Modified Files:
      Tag: branch_1_0
	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.22.2.3
retrieving revision 1.22.2.4
diff -u -d -r1.22.2.3 -r1.22.2.4
--- userdb-passwd-file.c	14 Mar 2007 13:59:02 -0000	1.22.2.3
+++ userdb-passwd-file.c	14 Mar 2007 14:42:16 -0000	1.22.2.4
@@ -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