[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Bad search filter



At 09:57 AM 2002-02-14, oberwetter, josh wrote:

>I can search for various entries using JNDI, but not ldapsearch. The ldapsearch tool is giving me the following error: 
>ldapsearch: ldap_search_ext: Bad search filter (87) 
>
>I may or may not have a rough understanding of why this is the case. For example, the error is thrown when the search filter contains characters that have special meanings in the LDAP search operations and in regular expressions 
>
>"(uid=piped|value)" 
>"(uid=single'quote)" 
>"(uid=left[bracket)" 
>"(uid=right]bracket)" 
>"(uid=question?mark)" 
>
>The uid values are valid, so how do I search for them? How can I escape the special characters in ldapsearch, and is there a complete list of characters that I have to escape in a search filter (e.g. I found that the left and right brackets don't work)?

You need to escape the special characters from your command
line interpreter (or shell).  While the set of special characters
and escaping mechanisms differ from interpreter, most Unix shells
treat strings wrapped with single quotes literally.  That is,
try '(uid=value)'.