# Net::LDAP 0.0.4 filter warnings

**URL:** <https://www.ruby-forum.com/t/net-ldap-0-0-4-filter-warnings/65255>\
**Category:** Ruby\
**Created:** [August 17, 2006, 1:37am UTC](https://www.ruby-forum.com/t/net-ldap-0-0-4-filter-warnings/65255 "2006-08-17T01:37:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![barjunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Post date:** [August 17, 2006, 1:37am UTC](https://www.ruby-forum.com/t/net-ldap-0-0-4-filter-warnings/65255/1 "2006-08-17T01:37:18Z")

</div>

I’m writing some new code and using #!/usr/bin/ruby -w as the bang line  
in the script.

The code looks like:

require ‘rubygems’  
require ‘net/ldap’

filter = Net::LDAP::Filter.eq( “key”,“value” )  
ldap.search (:base =\>treebase, :filter =\> filter)

I get:

/usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:310:  
warning: ambiguous first argument; put parentheses or even spaces  
/usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:311:  
warning: ambiguous first argument; put parentheses or even spaces  
/usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:324:  
warning: ambiguous first argument; put parentheses or even spaces  
/usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:338:  
warning: ambiguous first argument; put parentheses or even spaces  
/usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:356:  
warning: ambiguous first argument; put parentheses or even spaces  
/usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:358:  
warning: ambiguous first argument; put parentheses or even spaces  
/usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:360:  
warning: ambiguous first argument; put parentheses or even spaces

These warnings occurs after the filter line but before the search line.

This looks like it is at the lines that have:

scanner.scan

What needs to be done to make those warnings go away?

Mike B.

---

<div class="post-metadata">

**Author:** ![barjunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Post date:** [August 17, 2006, 2:01am UTC](https://www.ruby-forum.com/t/net-ldap-0-0-4-filter-warnings/65255/2 "2006-08-17T02:01:20Z")

</div>

On 8/16/06, barjunk [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> filter = Net::LDAP::Filter.eq( “key”,“value” )  
> /usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:324:

Well that’s odd! Never saw that in any of my testing. What version of  
Ruby are you using? I’ve patched the code in Rubyforge. Sync to the  
latest and see if the problem goes away.

Come to think of it, I don’t like this very much. There should have  
been no warnings. The code path you’re looking at is a recursive  
descent parser, and it got touched a few days ago. If you’re feeling  
frisky, would you please get version 0.0.3 of Net::LDAP and see if you  
get the same problem? Perhaps a regression crept into 0.0.4.

---

<div class="post-metadata">

**Author:** ![barjunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Post date:** [August 17, 2006, 4:01am UTC](https://www.ruby-forum.com/t/net-ldap-0-0-4-filter-warnings/65255/3 "2006-08-17T04:01:27Z")

</div>

On 8/16/06, barjunk [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> These warnings occurs after the filter line but before the search  
> line.
> 
> This looks like it is at the lines that have:
> 
> scanner.scan
> 
> What needs to be done to make those warnings go away?

Umm… any feedback, Barjunk? If this is not a real problem, I want to  
rollback the code changes I made.

---

<div class="post-metadata">

**Author:** ![barjunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Post date:** [August 17, 2006, 2:10am UTC](https://www.ruby-forum.com/t/net-ldap-0-0-4-filter-warnings/65255/4 "2006-08-17T02:10:20Z")

</div>

On 8/16/06, barjunk [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> filter = Net::LDAP::Filter.eq( “key”,“value” )  
> /usr/lib/ruby/gems/1.8/gems/ruby-net-ldap-0.0.4/lib/net/ldap/filter.rb:324:

I can’t get those warnings to appear, and I tried all kinds of ways.  
Also, they occur in a code path that is not exercised by your code  
sample. Can you send me a whole program that exhibits the flaw?  
(Private email is fine.)

---

<div class="post-metadata">

**Author:** ![barjunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Post date:** [August 17, 2006, 7:04am UTC](https://www.ruby-forum.com/t/net-ldap-0-0-4-filter-warnings/65255/5 "2006-08-17T07:04:40Z")

</div>

Francis C. wrote:

> Umm… any feedback, Barjunk? If this is not a real problem, I want to  
> rollback the code changes I made.

They show up if you run with -w. Personally, I think the parens help  
with readability in this case.

Just my .02.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![barjunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Post date:** [August 17, 2006, 6:56pm UTC](https://www.ruby-forum.com/t/net-ldap-0-0-4-filter-warnings/65255/6 "2006-08-17T18:56:48Z")

</div>

Francis C. wrote:

> > > 
> > 
> > Regards,  
> > The current version in Rubyforge SVN does not give the warnings. I’ll  
> > hold off another release for a few days in case anything else turns  
> > up.

Sorry for the late response…I only get digests and have been busy on  
a project. I will update to the latest and see what happens.

Mike B.

---

<div class="post-metadata">

**Author:** ![barjunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Post date:** [August 17, 2006, 10:34am UTC](https://www.ruby-forum.com/t/net-ldap-0-0-4-filter-warnings/65255/7 "2006-08-17T10:34:51Z")

</div>

On 8/17/06, Daniel B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 
> 
> Dan

Got it. Thanks, Dan. I outsmarted myself- I thought about -w (which  
barjunk mentioned) but instead of testing it the easy way, I added  
$VERBOSE=true to my test script, and that didn’t produce any warnings.

The current version in Rubyforge SVN does not give the warnings. I’ll  
hold off another release for a few days in case anything else turns  
up.

---

<div class="post-metadata">

**Author:** ![barjunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Post date:** [August 17, 2006, 8:33pm UTC](https://www.ruby-forum.com/t/net-ldap-0-0-4-filter-warnings/65255/8 "2006-08-17T20:33:05Z")

</div>

barjunk wrote:

> > > > > What needs to be done to make those warnings go away?
> > 
> > The current version in Rubyforge SVN does not give the warnings. I’ll  
> > hold off another release for a few days in case anything else turns  
> > up.
> 
> Sorry for the late response…I only get digests and have been busy on  
> a project. I will update to the latest and see what happens.
> 
> Mike B.

I don’t have an svn client at the moment and not going to be able to  
(time wise) be able to get to that any time soon…if you can build a  
gem for me, I’ll be able to test it easily. Sorry about that.

Mike B.

---

<div class="post-metadata">

**Author:** ![barjunk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ec8ea/32.png) [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Post date:** [August 17, 2006, 8:57pm UTC](https://www.ruby-forum.com/t/net-ldap-0-0-4-filter-warnings/65255/9 "2006-08-17T20:57:08Z")

</div>

On 8/17/06, barjunk [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I don’t have an svn client at the moment and not going to be able to  
> (time wise) be able to get to that any time soon…if you can build a  
> gem for me, I’ll be able to test it easily. Sorry about that.

I think the ML bounced it. I emailed it to your private email.
