* Quanah Gibson-Mount <[EMAIL PROTECTED]> [20050324 10:27]:
> 
> Hm, mine is:
> 
> #!/usr/local/bin/perl -w
> use Net::LDAP;
> use MIME::Base64;
> use Authen::SASL;
> use Socket;
> 
> $server='ldap.stanford.edu';
> my $name = gethostbyaddr(inet_aton($server), AF_INET);
> 
> my $ldap = Net::LDAP->new($name, version=>3) || die "$@";
> 
> my $slavesasl = Authen::SASL->new(mechanism=>'GSSAPI');
> my $mesg = $ldap->bind("", sasl=>$slavesasl);
> 
> $mesg->code && die $mesg->error;
> 
> $mesg = 
> $ldap->search(async=>1,filter=>"(uid=quanah)",base=>"dc=stanford,dc=edu");
> 
> @entries = $mesg->entries;
> 
> foreach $entry (@entries) {
>     $entry->dump;
> }
> 
> 
> You shouldn't have to initialize the callbacks at all by default (just a 
> note).

Your code (w/o the callbacks) didn't work for me either.  But the
following modification made it work for me:

    12c12,19
    < my $slavesasl = Authen::SASL->new(mechanism=>'GSSAPI');
    ---
    > my $slavesasl = Authen::SASL->new(
    >           mechanism=>'GSSAPI',
    >           callback => {
    >               'user' => sub {''},
    >               'password' => sub {''},
    >               },
    > );
    >

Ben

Reply via email to