CC: | "'gbarr [...] pobox.com'" <gbarr [...] pobox.com> |
Subject: | Authen::SASL::Perl::GSSAPI bug with ldaps |
Date: | Tue, 30 Nov 2010 16:08:30 -0700 |
To: | "'bug-Authen-SASL [...] rt.cpan.org'" <bug-Authen-SASL [...] rt.cpan.org> |
From: | Steven L Jeffs <steve [...] csbs.utah.edu> |
I have a simple script based on the example. It binds ok but fails to search. The same script binds and searches successfully when not using "ldaps://". Seems like a bug. Any help is appreciated.
Error message:
Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/site_perl/5.8.8/Authen/SASL/Perl.pm line 255, <DATA> line 522.
Script:
#!/usr/local/bin/perl -w
use strict;
use Net::LDAP;
use Authen::SASL qw(Perl);
#my $adhost = 'myhost.com';
#vs
my $adhost = 'ldaps://myhost.com';
my $ldap_base = 'DC=myhost,DC=com';
my $ldap_filter = '(&(sAMAccountName=ab999999))';
my $sasl = Authen::SASL->new(mechanism => 'GSSAPI');
my $ldap;
eval {
$ldap = Net::LDAP->new($adhost,
onerror => 'die')
or die "Cannot connect to LDAP host '$adhost': '$@'";
$ldap->bind(sasl => $sasl);
};
if ($@) {
chomp $@;
die "\nBind error : $@",
"\nDetailed SASL error: ", $sasl->error,
"\nTerminated";
}
print "\nLDAP bind() succeeded, working in authenticated state\n";
my $mesg = $ldap->search(base => $ldap_base,
filter => $ldap_filter);
foreach my $entry ( $mesg->entries ) {
my $name = $entry->get_value( "cn" );
print $name . "\n";
}
-Steve