perl-ldap - Net::LDAP::FilterMatch can't match substring filters

Posted on Fri Jun 6 01:58:05 2008 by mpc
Net::LDAP::FilterMatch can't match substring filters
A bug as been reported recently, and must have been present for quite some time (at least since v0.34) where a filter match will not return any results on a filter for substring.
As per the FilterMatch example, there are no matches found even if logic dictates that it should.
Example from FilterMatch POD
use Net::LDAP::Entry; use Net::LDAP::Filter; use Net::LDAP::FilterMatch; my $entry = new Net::LDAP::Entry; $entry->dn("cn=dummy entry"); $entry->add ( 'cn' => 'dummy entry', 'street' => [ '1 some road','nowhere' ] ); my @filters = (qw/(cn=dummy*) (ou=*) (&(cn=dummy*)(street=*road)) (&(cn=dummy*)(!(street=nowhere)))/); for (@filters) { my $filter = Net::LDAP::Filter->new($_); print $_,' : ', $filter->match($entry) ? 'match' : 'no match' ,"\n"; }

Unfortunatly, I do not have the luxury to wait for an official bug fix...
Does someone encountered the bug and fixed his own Filter.pm and/or FilterMatch.pm? If so, can you give me a hint please... I need to put something in production and I'm going in vacation...
Thanks,
MPC
Direct Responses: 8062 | Write a response