parameter problem

Hans Aschauer Hans.Aschauer at Physik.uni-muenchen.de
Mon Jul 22 14:12:49 CEST 2002


On Montag, 22. Juli 2002 13:43, Klaus Boehm wrote:
> I have this line in my sourcecode.
>
>
> s = l.search_s("ou=xxxxx, o=xxx", ldap.SCOPE_SUBTREE, gecos,
> attrlist=['uidnumber','gidnumber','uid'], attrsonly=0)
>
> and i want pass the parameter filterstring as a variable(gecos) from
> another programm(Website).
> But i get an error:             "ldap.FILTER_ERROR: {'desc': 'Bad
> search filter'}"
>
> What can i do to avoid this error?

Could you please tell us the contents of the gecos variable? Since the 
error is a 'Bad search filter', it would be really helpful to know the 
search filter...

Useful searchfilters look like '(objectclass=*)', or '(gecos=xyz)'. If 
xyz is in your gecos variable, you can build the search filter with 
'(gecos=%s)' % gecos

HTH,

Hans


-- 
Hans.Aschauer at Physik.uni-muenchen.de






More information about the python-ldap mailing list