From: Michael S. <mi...@st...> - 2010-07-01 16:05:16
|
Anil wrote: > I pass a filter string such as this to search(), but I keep getting > BAD SEARCH FILTER error. > "(|(last-login-time<=100101*)(!(last-login-time=*)))" Using <= with * in the assertion value looks bogus to me. > The same thing works when using it with ldapsearch command. Does not work for me when using OpenLDAP's ldapsearch: $ ldapsearch "(|(last-login-time<=100101*)(\!(last-login-time=*)))" ldapsearch: ldap_search_ext: Bad search filter (-7) Note the extra back-shlash needed before ! since ! is a special char for the shell. > I also > tried running it through ldap.filter.escape_filter_chars. You should not pass complete filter strings to ldap.filter.escape_filter_chars(). This function should only be used for the assertion values you put into the filter string afterwards. > Is this a known bug? Nope. Ciao, Michael. |