Skip to content

Commit

Permalink
dict-ldap: Don't reuse dict for different usernames.
Browse files Browse the repository at this point in the history
Fixes doing priv/* lookups for multiple usernames.

This currently also means that each username will create a separate LDAP
connection, which isn't ideal. But this is probably better fixed in
lib-ldap code similar to how lib-sql does connection pooling.
  • Loading branch information
sirainen committed May 2, 2016
1 parent 80aac21 commit 8a03829
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib-dict-extra/dict-ldap.c
Expand Up @@ -239,7 +239,8 @@ int ldap_dict_init(struct dict *dict_driver, const char *uri,
for(struct ldap_dict *ptr = ldap_dict_list;
ptr != NULL;
ptr = ptr->next) {
if (strcmp(ptr->uri, uri) == 0) {
if (strcmp(ptr->uri, uri) == 0 &&
null_strcmp(ptr->username, set->username) == 0) {
*dict_r = (struct dict*)ptr;
return 0;
}
Expand Down

0 comments on commit 8a03829

Please sign in to comment.