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

dovecot at dovecot.org dovecot at dovecot.org
Tue May 12 20:45:43 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/d59748e6a8e8
changeset: 9024:d59748e6a8e8
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 4323944abc43 -r d59748e6a8e8 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
@@ -949,6 +949,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