php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47786 ldap_list get "Decoding error" on some specific searching attribute
Submitted: 2009-03-26 09:46 UTC Modified: 2013-10-15 11:54 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: tedc21thc at hotmail dot com Assigned:
Status: No Feedback Package: LDAP related
PHP Version: 5.2.9 OS: FreeBSD 7.1
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tedc21thc at hotmail dot com
New email:
PHP Version: OS:

 

 [2009-03-26 09:46 UTC] tedc21thc at hotmail dot com
Description:
------------
target ldap server : notes
PHP version : 5.2.9(CLI)
OS: FreeBSD ( tested on 5.4 and 7.1)
When using "ldap_list" on specific basedn and specific attribute combination will get "Decoding error" (-4) error.

look seems like bug #5433....
But "Decoding error" only happens on searching for 
("cn","mail","proxyaddresses","ou") attributes,
and will NOT get error if changing these attirbute's sorting or add/remove some other attributes.

ps: using ldap_search wont get error.

Reproduce code:
---------------
$ldp_svrip ='192.168.100.150';   // IP
$ldp_acc = '';
$ldp_pwd = '';
$ldp_svrport ='5555';   // Port
$ldp_dn = 'OU=tw,O=iei2';   // DN
$ldp_filter = '(objectclass=*)';   // FILTER
$ldp_jth = array("cn","mail","proxyaddresses","ou");   // Attribute
$ds = ldap_connect($ldp_svrip, $ldp_svrport) ;
$rbind = ldap_bind($ds, $ldp_acc, $ldp_pwd);
$sr = @ldap_list($ds, $ldp_dn, $ldp_filter, $ldp_jth);
echo LDAP_ERROR($ds);
$info = ldap_get_entries($ds, $sr);

Expected result:
----------------
"Success"

Actual result:
--------------
"Decoding error"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-31 07:37 UTC] jani@php.net
What makes you think it's not expected result?

From manual about ldap_list():

"LDAP_SCOPE_ONELEVEL means that the search should only return 
information that is at the level immediately below the base_dn given 
in the call. (Equivalent to typing "ls" and getting a list of files 
and folders in the current working directory.)"

 [2009-04-01 01:53 UTC] tedc21thc at hotmail dot com
the problem is when I change the searching attribute from 
("cn","mail","proxyaddresses","ou")
to any other
like... ("mail","cn","proxyaddresses","ou") <- only switching sorting
or... ("cn","mail","proxyaddresses","ou","something") <- add something or remove something
or whatever

the result of ""LDAP_ERROR($ds)"" become success,
and I can get values from
$info = ldap_get_entries($ds, $sr);
and following steps.....
 [2009-04-08 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2010-12-24 10:31 UTC] tedc21thc at hotmail dot com
Hello there,
It seems be #5433 only fixed "ldap_search()" function,but not also fix ldap_list() function.
please check again.

The problem is, it will get Decoding error (-4) when querying some OU and have attributes.

When I get decoding error, and I use this function again with no argument 4(attributes), It will be fine.

samples:

When
$sr= @ldap_list($this->conn,$dn,$this->filter,$this->attrs);
ldap_errno($this->conn) sometimes will be -4
gets Decoding error, query fails.

Try use
$sr= @ldap_list($this->conn,$dn,$this->filter);

ldap_errno($this->conn) will be 0
and the data entries will be fine
 [2010-12-24 10:41 UTC] tedc21thc at hotmail dot com
-Status: No Feedback +Status: Closed
 [2010-12-24 10:41 UTC] tedc21thc at hotmail dot com
It seems be #5433 only fixed "ldap_search()" function,but not also fix ldap_list() function.
please check again.

The problem is, it will get Decoding error (-4) when querying some OU and have attributes.

When I get decoding error, and I use this function again with no argument 4(attributes), It will be fine.

samples:

When
$sr= @ldap_list($this->conn,$dn,$this->filter,$this->attrs);
ldap_errno($this->conn) sometimes will be -4
gets Decoding error, query fails.

Try use
$sr= @ldap_list($this->conn,$dn,$this->filter);

ldap_errno($this->conn) will be 0
and the data entries will be fine
 [2012-04-30 07:40 UTC] tedc21thc at hotmail dot com
please solve this problem for ldap_list(); ( see:#5433 for ldap_search(); )
 [2012-04-30 07:40 UTC] tedc21thc at hotmail dot com
-Status: Closed +Status: Assigned
 [2013-09-30 11:24 UTC] mike@php.net
-Status: Assigned +Status: Feedback
 [2013-09-30 11:24 UTC] mike@php.net
There's no difference in what PHP does for ldap_search and ldap_list, except that ldap_lsit uses LDAP_SCOPE_ONELEVEL.
 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 04:01:27 2024 UTC