LDAP module: ldap_read_entries not compatible with binary attributes
| From: | Leo | Date: | Wed, 21 Mar 2001 14:50:29 +0000 |
| Subject: | LDAP module: ldap_read_entries not compatible with binary attributes | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-49621@lists.php.net to get a copy of this message | ||
Hello
I just got into troubles when using ldap_read_entries() on binary
attributes, i my program a usercertificate :
On binary data, ldap_read_entries() returns garbages whenever it meets
a NULL character.
I know the longer way to do it, using a sequence of ldap_first_entry(
), ldap_first_attribute( ), ldap_get_values_len,
ldap_next_attribute().
but this is a pain for the lazy programmers.
A solution would be an extra parameter or an option to instruct
ldap_read_entries() to use ldap_get_values_len() instead of
ldap_get_values :
ldap.c lines 1018-1020:
while (attribute != NULL) {
ldap_value = ldap_get_values(ldap, ldap_result_entry, attribute);
num_values = ldap_count_values(ldap_value);
Does anyone see a better way to fix that ?
--Leo West