When I passed the several attibutes as the attrs argument to util_ldap_cache_getuserdn and the first attribute value from a LDAP entry was null, all attribute values weren't cached. I think that the following codes in util_ldap_cache.c are causes. If node->vals[0] is null, all node->vals[i] aren't copied to cache. void *util_ldap_search_node_copy(util_ald_cache_t *cache, void *c) ... /* copy vals */ if (node->vals) { int k = 0; int i = 0; while (node->vals[k++]); if (!(newnode->vals = util_ald_alloc(cache, sizeof(char *) * (k+1)))) { util_ldap_search_node_free(cache, newnode); return NULL; } while (node->vals[i]) { if (!(newnode->vals[i] = util_ald_strdup(cache, node->vals [i]))) { util_ldap_search_node_free(cache, newnode); return NULL; } i++; } } ...
Fixed in 2.1/2.2 version of util_ldap. The number of attributes is stored along with the values so that the code can rely on an actual count rather than terminating at the first NULL value.
*** Bug 36563 has been marked as a duplicate of this bug. ***