--On Tuesday, August 09, 2005 1:51 PM -0700 Larry Lile
<[EMAIL PROTECTED]> wrote:
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.
Well, to me the difference is this is something that I know pulls together
all the pieces, and works, with examples supplied in the tar ball that
should be trivial to modify for your environment. Obviously it'll use your
TGT if you already have one (as several of the examples do).
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.
The difference is, I know my code works. I don't see anything obviously
wrong with your code, but one never knows. If you get the same error with
my code, there's something more fundamentally at issue than just the code.
Regardless, I can say for sure, there is something else fundamentally wrong
with your setup, because if I modify your script for my environment, it
works perfectly:
#!/usr/local/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('ldap6.stanford.edu', 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=quanah)",base=>"dc=stanford,dc=edu");
@entries = $mesg->entries;
foreach $entry (@entries) {
$entry->dump;
}
[snip lots of output, then]
Net::LDAP=HASH(0x8289a10) received:
30 0C 02 01 04 65 07 0A 01 00 04 00 04 00 __ __ 0....e........
------------------------------------------------------------------------
dn:uid=quanah,cn=Accounts,dc=Stanford,dc=edu
cn: Quanah Gibson-Mount
gecos: Quanah Gibson-Mount
gidNumber: 37
homeDirectory: /afs/ir/users/q/u/quanah
krb5PrincipalName: [EMAIL PROTECTED]
loginShell: /bin/tcsh
suAccountStatus: active
suAfsHomeDirectory: /afs/ir/users/q/u/quanah
suAfsStatus: active
suCreateAgent: AccountSlog
suDialinStatus: active
suEmailAccountType: personal
suEmailAdmin: quanah
suEmailStatus: active
suEntryStatus: active
suKerberosStatus: active
suLelandStatus: active
suName: Quanah Gibson-Mount
suNameLF: Gibson-Mount, Quanah
suPtsStatus: active
suPtsUid: 54046
suSeasStatus: active
suSeasSunetID: qgibsonmount
quanah
quanahgibsonmount
suSeasUriRouteTo: /~quanah
uid: quanah
uidNumber: 54046
suCreateAPI: JNDI
suKrb4Name: [EMAIL PROTECTED]
description: Information Technology Systems and Services, Principal
Sys Admin, QA, Programmer, Webmaster
suDescription: Information Technology Systems and Services, Principal
Sys Admin, QA, Programmer, Webmaster
suMailDrop: [EMAIL PROTECTED]
suService: dialin
afs
leland
email
seas
pts
kerberos
objectClass: posixAccount
suPtsService
suAccount
suOperational
suLelandService
suAfsService
suEmailService
suDialinService
suKerberosService
suSeasService
owner:
suRegID=85e49978f61311d2ae662436000baa77,cn=People,dc=Stanford,dc=edu
seeAlso:
suRegID=85e49978f61311d2ae662436000baa77,cn=People,dc=Stanford,dc=edu
suIdentifies:
suRegID=85e49978f61311d2ae662436000baa77,cn=People,dc=Stanford,dc=edu
suEmailQuota: 100
--
Quanah Gibson-Mount
Principal Software Developer
ITSS/Shared Services
Stanford University
GnuPG Public Key: http://www.stanford.edu/~quanah/pgp.html
"These censorship operations against schools and libraries are stronger
than ever in the present religio-political climate. They often focus on
fantasy and sf books, which foster that deadly enemy to bigotry and blind
faith, the imagination." -- Ursula K. Le Guin