google-code-export / ruby-activeldap

Automatically exported from code.google.com/p/ruby-activeldap
Other
1 stars 1 forks source link

Problem with Colon n an attribue value #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Person.find(:first, :attribute=>"isMemberOf", :value=> "COMMUNITY:ALL")
2. Tried the net-ldap query directly and it seemed fine

3.

What is the expected output? What do you see instead?
I expect a record to come back from the directory.  If I do a ldap query for an 
attribute that does not contain a colon or I replace the colon with a *, it 
works fine.

The error I get is:
Net::LDAP::LdapError: invalid filter syntax
    from /opt/local/lib/ruby/gems/1.8/gems/net-ldap-0.1.1/lib/net/ldap/filter.rb:407:in `initialize'
    from /opt/local/lib/ruby/gems/1.8/gems/net-ldap-0.1.1/lib/net/ldap/filter.rb:389:in `new'
    from /opt/local/lib/ruby/gems/1.8/gems/net-ldap-0.1.1/lib/net/ldap/filter.rb:389:in `construct'
    from /opt/local/lib/ruby/gems/1.8/gems/net-ldap-0.1.1/lib/net/ldap.rb:1352:in `search'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/adapter/net_ldap.rb:143:in `send'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/adapter/net_ldap.rb:143:in `execute'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/adapter/base.rb:659:in `log'
    from /opt/local/lib/ruby/1.8/benchmark.rb:308:in `realtime'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/adapter/base.rb:659:in `log'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/adapter/net_ldap.rb:141:in `execute'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/adapter/net_ldap.rb:78:in `search'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/adapter/base.rb:170:in `search'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/adapter/base.rb:275:in `operation'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/timeout.rb:15:in `call'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/timeout.rb:15:in `alarm'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/adapter/base.rb:321:in `with_timeout'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/adapter/base.rb:274:in `operation'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/adapter/base.rb:169:in `search'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/adapter/net_ldap.rb:66:in `search'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/operations.rb:65:in `search'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/operations.rb:284:in `find_every'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/operations.rb:257:in `find_initial'
    from /opt/local/lib/ruby/gems/1.8/gems/activeldap-1.2.2/lib/active_ldap/operations.rb:222:in `find'
    from (irb):56

What version of the product are you using? On what operating system?
Ubuntu 10.04; current activeldap 1.2.2; ruby 1.8.7 (2009-06-12 patchlevel 174) 
[x86_64-linux]

Please provide any additional information below.

Any help or guidance on where I am making a mistake would be welcome.
thanks for your time,
Mike

Original issue reported on code.google.com by planet...@gmail.com on 8 Jul 2010 at 4:41

GoogleCodeExporter commented 9 years ago
p.s.:  I did try running the ActiveLdap::Escape::ldap_filter_escape(str), but 
it did not resolve the problem.

Original comment by planet...@gmail.com on 8 Jul 2010 at 4:46

GoogleCodeExporter commented 9 years ago
Thanks for reporting.
I've fixed it in trunk.

Original comment by kou...@gmail.com on 9 Jul 2010 at 12:49

GoogleCodeExporter commented 9 years ago
Wow, that was fast.  I was slowly looking through the code trying to trace it 
as my free time allowed.  

Thanks!

Original comment by planet...@gmail.com on 9 Jul 2010 at 5:15