--On Monday, August 23, 2004 6:30 PM +0000 "Derek T. Yarnell" <[EMAIL PROTECTED]> wrote:

RHEL3 WS box with own version of perl 5.8.2 in /usr/local/perl-5.8.2

What version of Net::LDAP?

0.32

What version of Authen::SASL?

2.08

What version of cyrus-sasl?

[EMAIL PROTECTED] Authen]# rpm -qa | grep cyrus cyrus-sasl-md5-2.1.15-8 cyrus-sasl-gssapi-2.1.15-8 cyrus-sasl-devel-2.1.15-8 cyrus-sasl-plain-2.1.15-8 cyrus-sasl-2.1.15-8

I have installed the broken Authen::Cyrus::SASL and then read the
archives and installed Patrick's version. But I am a bit confused.

The only thing that has worked for me, is the latest Net::LDAP, with
the latest Authen::SASL, with cyrus-sasl-2.1.18 or later, with the
Authen::Cyrus::SASL that is maintained by Patrick, and *not* the one
that is on CPAN, which won't even compile out of the box against
cyrus-sasl2.

What code works for you? The docs are bit thin on this, atleast the creation of the sasl object.


#!/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("uid=quanah,cn=accounts,dc=stanford,dc=edu", sasl=>$slavesasl);


$mesg->code && die $mesg->error;

$mesg = $ldap->search(async=>1,filter=>"(uid=quanah)",base=>"dc=stanford,dc=edu");

@entries = $mesg->entries;

$entry = shift (@entries);
$uid = ($entry->get_value("uid"));
print "uid $uid\n";


--Quanah

--
Quanah Gibson-Mount
Principal Software Developer
ITSS/Shared Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html

Reply via email to