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

Re: LDAP search filter validation

Greg B wrote:

Does OpenLDAP provide any routines for validating whether a given
string represents a valid LDAP search filter? This is for me to detect
invalid configuration settings in my LDAP client, and report the
problem to the end-user as early as possible. For example, I want to
catch settings like LDAPFilter="(cn=foo)", since they don't conform to
the RFC 2254. Also, a side question, is the use of brackets around the
main filter definition compulsory? All of the LDAP tools I have at my
disposal seem to allow just cn=foo type filters...

thanks in advance,


Well, as a test I did objectclass>f (without quotes) and I got back an error stating "missing equals" so yes you can leave off the parenthesis and yes you will get validation related errors back (at least in some cases from what I've experienced).

hope that helps