dovecot-2.0: ldap: When using the same LDAP attribute multiple t...

dovecot at dovecot.org dovecot at dovecot.org
Tue May 12 20:46:20 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/b4dcdc5ccd8e
changeset: 9265:b4dcdc5ccd8e
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 12 13:45:37 2009 -0400
description:
ldap: When using the same LDAP attribute multiple times, give an error message.

diffstat:

1 file changed, 4 insertions(+)
src/auth/db-ldap.c |    4 ++++

diffs (14 lines):

diff -r 11b6aab8a203 -r b4dcdc5ccd8e src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Tue May 12 13:45:08 2009 -0400
+++ b/src/auth/db-ldap.c	Tue May 12 13:45:37 2009 -0400
@@ -950,6 +950,10 @@ void db_ldap_set_attrs(struct ldap_conne
 
 		if (*name != '\0' &&
 		    (skip_attr == NULL || strcmp(skip_attr, value) != 0)) {
+			if (hash_table_lookup(attr_map, name) != NULL) {
+				i_fatal("ldap: LDAP attribute '%s' used multiple times. This is currently unsupported.",
+					name);
+			}
 			hash_table_insert(attr_map, name, value);
 			(*attr_names_r)[j++] = name;
 		}


More information about the dovecot-cvs mailing list