php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21606 binary value not returned correctly
Submitted: 2003-01-12 23:55 UTC Modified: 2005-04-12 00:56 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: underling at yandex dot ru Assigned:
Status: Not a bug Package: LDAP related
PHP Version: 4.3.0 OS: Linux Debian
Private report: No CVE-ID: None
 [2003-01-12 23:55 UTC] underling at yandex dot ru
binary value which is kept in LDAP (like userCertificate or jpegPhoto attributes) not returned correctly when ldap_search call is made. In fact it returns only a few bytes of full attribute value. The problem is probably in some symbols in binary file which are cannot be exported by PHP so PHP simply breaks an export.
Below is hex-dump of what is actually exported instead of full file:
for jpegPhoto attribute:

00000000 FF D8 FF 00

for userCertificate attribute:

00000000 30 82 03 68 30 82 03 0B A0 03 02 01

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-10 01:45 UTC] owen at delong dot com
I'm experiencing this bug on Fedora Core 3 with PHP 4.3.1
package included in distro, used with Apache 2 and OpenLDAP.

I've tested and reproduced this bug with several versions of
openLDAP including the current released source version from
openldap.org.

    $sr=ldap_search($ds, $dn, "($u)");
    $user=ldap_get_entries($ds, $sr);

Used to retrieve an ldap entry which includes:
jpegPhoto: (72K Binary Data)

Returns only the first 10 octets of the Photo in question.
If you want a copy of the photo for testing, let me know
the best way to submit it to you and I will provide it.

I believe this to be related to bugs 5702/5759.  I'm able
to store the photo just fine as a result of that fix, but,
cannot retrieve it using ldap_search and ldap_get_entries.

If this is not enough data to pursue this bug, please
email me and let me know what additional data would be
useful.  I will happily provide whatever data I can that
would be useful.
 [2005-04-12 00:56 UTC] sniper@php.net
You should be using ldap_get_values_len() which is binary safe. ldap_get_entries() is not binary safe.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 18:01:30 2024 UTC