Edit report at http://bugs.php.net/bug.php?id=47786&edit=1
ID: 47786 User updated by: tedc21thc at hotmail dot com Reported by: tedc21thc at hotmail dot com Summary: ldap_list get "Decoding error" on some specific searching attribute -Status: No Feedback +Status: Closed Type: Bug Package: LDAP related Operating System: FreeBSD 7.1 PHP Version: 5.2.9 Block user comment: N Private report: N New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2010-12-24 10:31:38] 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 ------------------------------------------------------------------------ [2009-04-08 01:00:00] 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". ------------------------------------------------------------------------ [2009-04-01 01:53:45] 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-03-31 07:37:09] j...@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-03-26 09:46:53] 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" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=47786&edit=1