[php-maint] Attribute in LDAP Search truncated

mail at oliwel.de mail at oliwel.de
Wed Nov 19 17:36:43 UTC 2008

Package: php5-ldap
Version: 5.2.0-8+etch13  
Severity: important

We use ldap to search PKI certificates from an LDAP server.
We deployed the project to a debian etch box, running php 5.2.0-8 from
The certificate returned by the search is around 1300 Bytes binary data.
The attached code returns a field trunctated to 33 Bytes, a dev system
running lenny and some other OS boxes return a correct vertificate which is
usable by Openssl lateron.

Following snippet shows the problem:

ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
$sr=ldap_search($ds,"o=trustcenter","mail=peter at siemens.com");
printf ("No of Entries: %d\n",ldap_count_entries($ds,$sr));

$info = ldap_get_entries($ds, $sr);
printf ("Length of response: %d\n\nData:%s\n",

Expected Output:
No of Entries: 1
Length of response: 1323

Received Output:
No of Entries: 1
Length of response: 33

using ldapsearch from the commandline returns correct results, so I asume
its in the php-ldap binding and not in the ldap code.



More information about the pkg-php-maint mailing list