From: Graham B. <gb...@us...> - 2002-02-18 16:51:46
|
Update of /cvsroot/perl-ldap/ldap/lib/Net In directory usw-pr-cvs1:/tmp/cvs-serv5539/lib/Net Modified Files: LDAP.pm Log Message: Change over to using Authen::SASL v2.00, which is now distributed in a separate distribution Index: LDAP.pm =================================================================== RCS file: /cvsroot/perl-ldap/ldap/lib/Net/LDAP.pm,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- LDAP.pm 18 Feb 2002 15:58:27 -0000 1.29 +++ LDAP.pm 18 Feb 2002 16:51:42 -0000 1.30 @@ -239,15 +239,26 @@ my $sasl = $passwd; # Tell the SASL object our user identifier - $sasl->user("dn: $dn") unless $sasl->user; + $sasl->callback( user => "dn: $stash{name}") + unless $sasl->callback('user'); + + my $sasl_conn = $sasl->client_new("ldap",$ldap->{net_ldap_host}); + + # Tell SASL the local and server IP addresses + $sasl_conn->property( + sockname => $ldap->{net_ldap_socket}->sockname, + peername => $ldap->{net_ldap_socket}->peername, + ); + + my $initial = $sasl_conn->client_start; $passwd = { - mechanism => $sasl->name, - credentials => $sasl->initial + mechanism => $sasl_conn->mechanism, + credentials => $initial }; # Save data, we will need it later - $mesg->_sasl_info($stash{name},$control,$sasl); + $mesg->_sasl_info($stash{name},$control,$sasl_conn); } $stash{authentication} = { $auth_type => $passwd }; |