On Tue, 9 Aug 2005, Quanah Gibson-Mount wrote:
>
>
> --On Tuesday, August 09, 2005 11:47 AM -0700 Larry Lile
> <[EMAIL PROTECTED]> wrote:
>
> > I'm still unable to get Net::LDAP and Authen::SASL::Cyrus to play
> > nice. I'm using perl-ldap 0.33 and Authen-SASL-Cyrus-0.12-server
> > with perl-5.8.6.
> >
> > I get a slightly different result "Use of uninitialized value" but
> > I have elicited the "Local error" message before.
> >
> > Using the test script:
> >
> ># !/opt/perl-5.8.6/bin/perl -w
> > use Net::LDAP;
> > use Authen::SASL;
> >
> > my $slavesasl = Authen::SASL->new(mechanism=>'GSSAPI',
> > 'user' => " ", # empty callback, so Net::LDAP don't overrides it
> > );
> >
> > my $ldap = Net::LDAP->new('ldap1', version=>3, async=>1, debug =>3) ||
> > die "$@";
> >
> > my $mesg = $ldap->bind("", sasl=>$slavesasl, async=>1);
> >
> > $mesg->code && die $mesg->error;
> >
> > $mesg =
> > $ldap->search(async=>1,filter=>"(uid=lile)",base=>"dc=anim,dc=dreamworks,
> > dc=com");
> > @entries = $mesg->entries;
> >
> > foreach $entry (@entries) {
> > $entry->dump;
> > }
>
> Just out of curiosity, have you looked at or tried my abstracted perl
> module that goes on top of Net::LDAP and Authen::SASL?
>
> <http://www.stanford.edu/services/directory/clients/perl.html>
>
> I use it to make SASL/GSSAPI connections to our OpenLDAP servers all the
> time...
I don't see how it would help, you are using Net::LDAP to create
a connection to the server, I already have a TGT so we'll skip
that part, then you create an Authen::SASL::GSSAPI object the
bind the Net::LDAP connection with the SASL cred.
Not using async and not setting user=" " still give the same result
so I can't see a difference. Using Stanford::Directory is just going
to give me more layers to debug and I can't believe it's going to change
the result.
>From Stanford-Directory-3.0.7/Directory.pm:
# Connect to the server
my $serverName = gethostbyaddr(inet_aton($self->ldap_server()),
AF_INET);
$ld = Net::LDAP->new($serverName,version=>$self->version());
if ($ld == -1) {
$self->error_type("System");
$self->error("Could not connect to directory server (" .
$self->ldap_server .")");
return ();
}
[...]
# Bind to the directory
my $status;
my $sasl;
if ($self->mechanism) {
$sasl = Authen::SASL->new($self->mechanism());
$status = $ld->bind("", sasl=>$sasl);
}
else {
$status = $ld->bind("");
}
if ($status->code && $status->error) {
$self->error_type("System");
$self->error("Bind failed - " . $status->error . " (STATUS: " .
$status->code . ")");
return ();
}
$self->{connection_handle}=$ld;
--
Larry