Skip Menu |

This queue is for tickets about the perl-ldap CPAN distribution.

Report information
The Basics
Id: 39771
Status: rejected
Priority: 0/
Queue: perl-ldap

People
Owner: Nobody in particular
Requestors: OSALAUN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.38
Fixed in: (no value)



Subject: Empty scope interpreted as 'base'
We are using Net::LDAP within the mailing list software Sympa (http://www.sympa.org). If performing a search with an empty "scope" parameter, the search() function assumes the scope is "base" which is not appropriate in most cases ; "sub" would be a more appropriate default. Below is a code that demonstrates the problem : my $ldap = Net::LDAP->new( 'ldap.cru.fr' ) or die "$@"; my $mesg = $ldap->bind(); $mesg = $ldap->search(base => 'ou=People,dc=cru,dc=fr', scope => '', filter => '(uid=myuser)' ); The script won't be able to access our server but if it could, it would return no entry because the scope is inappropriate.
Subject: Re: [rt.cpan.org #39771] Empty scope interpreted as 'base'
Date: Thu, 2 Oct 2008 13:23:57 -0500
To: bug-perl-ldap [...] rt.cpan.org
From: Graham Barr <gbarr [...] pobox.com>
On Oct 2, 2008, at 7:48 AM, OSALAUN via RT wrote: Show quoted text
> If performing a search with an empty "scope" parameter, the search() > function assumes the scope is "base" which is not appropriate in most > cases ; "sub" would be a more appropriate default.
I think anyone can argue what the default should be, but ultimately the calling script is broken. If I were to make a change, and I am not suggesting I will, it would be to make ->search return an error of either LDAP_LOCAL_ERROR or LDAP_PARAM_ERROR Graham.