If I search for escaped characters, I can't use an asterisk (or begins/ends).
I think this is a bug in the LDAP gem itself.
Net::LDAP::Filter.begins("cn", "\\")
Doesn't return anything on our Microsoft Windows 2008 AD server even though there are a few CN's starting with backslash.
This does work though:
ldapsearch -E pr=200/noprompt -h
directory.example.com -x -D 'CN=example,CN=Users,DC=example,DC=com' -w 'password' -b 'dc=example,dc=com' -LLL '(cn=\5C*)'
It looks like the filter produces the expected "\5C*", but no results are returned for some reason. We looked at the output with wireshark, and it does appear that Net::LDAP sends different data than ldapsearch.
Actually, it appears that any escaped text doesn't work. '\2A*' doesn't work either.
Has anyone seen this before?