|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2014-02-16 19:10 UTC] post at rolandgruber dot de
 Description: ------------ A search with ldap_search() and then getting the entries with ldap_get_entries() returns different search results on OpenLDAP and ActiveDirectory. Example DN of a search result entry: cn=foo\, bar,dc=test Active Directory: cn=foo\, bar,dc=test OpenLDAP: cn=foo\5C\2C bar,dc=test So for OpenLDAP special chars in the DN are escaped and for Active Directory they are not. Expected result: ---------------- The returned DNs should be the same for all LDAP servers. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 19:00:02 2025 UTC | 
The DN should contain EITHER '\,' OR '\2C' but NOT '\5C\2C'. IMO that means that the value in the CN-Attribute already contains '\,' and not a simple ','. Can you please check that? Additionally I checked that against a third LDAP-Server: $ldap = ldap_connect('ldap://pksldap.tttc.de'); ldap_bind($ldap); $result = ldap_search($ldap, 'c=DE', 'sn=Jahneke'); $res = ldap_get_entries($ldap, $result); var_Dump($res[0]['dn']); //string(101) "cn=Jahneke\2C Ralf- ChristophSER:799945522,ou=T-TeleSec SigG Test CA 15:PN,o=Deutsche Telekom AG,c=de" var_Dump($res[0]['cn'][0]); string(37) "Jahneke, Ralf- ChristophSER:799945522" Could you run that agains your OpenLDAP and ActiveDirectory (with appropriately adapted search-filter)? Thanks!The DN should contain EITHER '\,' OR '\2C' but NOT '\5C\2C'. IMO that means that the value in the CN-Attribute already contains '\,' and not a simple ','. Can you please check that? Additionally I checked that against a third LDAP-Server: $ldap = ldap_connect('ldap://pksldap.tttc.de'); ldap_bind($ldap); $result = ldap_search($ldap, 'c=DE', 'sn=Jahneke'); $res = ldap_get_entries($ldap, $result); var_Dump($res[0]['dn']); //string(101) "cn=Jahneke\2C Ralf- ChristophSER:799945522,ou=T-TeleSec SigG Test CA 15:PN,o=Deutsche Telekom AG,c=de" var_Dump($res[0]['cn'][0]); string(37) "Jahneke, Ralf- ChristophSER:799945522" Could you run that agains your OpenLDAP and ActiveDirectory (with appropriately adapted search-filter)? Thanks!