1267: AD group selection fails when OU contains whitespace

nikolai.pr**********@gmai***** (Google Code) (Is this you? Claim this profile.)
Nov. 28, 2009
What version are you running?

1.0.1

What's the URL of the page containing the problem?

Login page

What steps will reproduce the problem?
1. Have a stupid AD with some Groups where an OU contains a space
2. Be a user in that group
3. Try to login

What is the expected output? What do you see instead?
Everything should work fine, instead there is a "Wrong password" notice and  
"Bad search filter" message from AD.

This obviously requires changing the line 
"group_data = self.search_ad(con, 
'(&(objectClass=group)(saMAccountName=%s))' % group)"

in backends.py / get_member_of, but I'm not familiar with LDAP query 
syntax...
david
#1 david
I just read through RFC 4515 and it looks like group names with spaces should be fine
in a filter spec like that.

Can you try adding double-quotes "" around the %s and test it?

'(&(objectClass=group)(saMAccountName="%s"))' % group
  • +NeedInfo
david
#2 david
  • +Component-Accounts
david
#3 david
  • -NeedInfo
    +Incomplete