I think this is a bug in Net::LDAP::Filter

From a suggestion on Perl Monks, I've narrowed the issue to the 
Net::LDAP::Filter module

https://www.perlmonks.org/?node_id=11128565

‘Bad’ objectGUID values seem to break this, and they return ‘undef’ for the 
filter object.

Code demonstrating the issue:

#!/usr/bin/perl

use strict;

use Net::LDAP::Filter;
use MIME::Base64 qw(encode_base64 decode_base64);

my $goodFilter = '(objectGUID = '.decode_base64('XrfAr5bivU61wz1WCgsxWA==').')';
my $badFilter = '(objectGUID = '.decode_base64('6CncwjzJ/Umi4iIdB88efw==').')';

print "Good filter:\n";
my $f1 = Net::LDAP::Filter->new($goodFilter);
$f1->print;

print "Bad filter:\n";
my $f2 = Net::LDAP::Filter->new($badFilter);
$f2->print;

Gives the error:

[webworker@dhbinternal2 restrict]$ ./filtertest.pl
Good filter:
(objectGUID= ^\b7\c0\af\96\e2\bdN\b5\c3=V\0a\0b1X)
Bad filter:
Can't call method "print" on an undefined value at ./filtertest.pl line 17.

the $badFilter is the same objectGUID value that gives the error I'm seeing in 
the demo code I sent yesterday without the uudencode/decode cycle so I know 
it’s not a problem with that module.

I can send along a number of objectGUID values (as either uuencoded binaries or 
the unpacked hex strings) that fail if it helps identify the problem. They 
represent about 10% of all our user accounts :-(

--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group

Institutions do not have opinions, merely customs

Reply via email to