From: Timo Sirainen Date: Tue, 12 May 2009 17:45:37 +0000 (-0400) Subject: ldap: When using the same LDAP attribute multiple times, give an error message. X-Git-Tag: 2.0.alpha1~787 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e434abb86a137bbe710320b5f5431804f05c6e26;p=thirdparty%2Fdovecot%2Fcore.git ldap: When using the same LDAP attribute multiple times, give an error message. --HG-- branch : HEAD --- diff --git a/src/auth/db-ldap.c b/src/auth/db-ldap.c index 7c5aceb2e5..83660b264a 100644 --- a/src/auth/db-ldap.c +++ b/src/auth/db-ldap.c @@ -950,6 +950,10 @@ void db_ldap_set_attrs(struct ldap_connection *conn, const char *attrlist, 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; }