php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2809 ldap_get_entries returns no values when only retrieving DN
Submitted: 1999-11-23 23:21 UTC Modified: 1999-11-28 18:20 UTC
From: robert dot everett at wcom dot com Assigned: venaas (profile)
Status: Closed Package: LDAP related
PHP Version: 3.0.12 OS: Solaris 2.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: robert dot everett at wcom dot com
New email:
PHP Version: OS:

 

 [1999-11-23 23:21 UTC] robert dot everett at wcom dot com
PHP 3.0.12
Apache 1.3.9
Netscape LDAP 4.11
Solaris 2.6

ldap_get_entries() returns false when only retrieving DN. It will also fail
if requesting attributes whose values are all empty.

-- Sometimes OK (CN & DN) --

$ld = ldap_connect("ldap.foobar.com", 389);

$base = "o=Foobar,c=US";
$attrs = array("cn");
$filter = "(uid=testuser)";

$sr = ldap_search($ld, $base, $filter, $attrs);
$info = ldap_get_entries($ld, $sr);

// OK as long as "cn" contains a value; otherwise $info is empty
echo $info[0]["dn"]."<br>";
echo $info[0]["cn"][0]."<br>";

ldap_unbind($ld);

-- Always Fails (DN only) --

$ld = ldap_connect("ldap.foobar.com", 389);

$base = "o=Foobar,c=US";
$attrs = array("dn");
$filter = "(uid=testuser)";

$sr = ldap_search($ld, $base, $filter, $attrs);
$info = ldap_get_entries($ld, $sr);

// fails; $info is always empty
echo $info[0]["dn"]."<br>";

ldap_unbind($ld);

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-28 18:20 UTC] venaas at cvs dot php dot net
I've found the bug and fixed it in the CVS tree, so it should be okay in
3.0.13. The bug is actually worse. If one entry has no values for the
specified attributes, no entries at all will be returned.

 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Dec 07 19:03:40 2021 UTC