On Thu, 8 Jul 2004, Quanah Gibson-Mount wrote:

> --On Thursday, July 08, 2004 4:50 PM -0700 Larry Lile 
> <[EMAIL PROTECTED]> wrote:
> 
> compiled against.
> >
> > Right.  But my question goes more to the fact that Net::LDAP.pm calls
> >
> >     $sasl_conn->property(
> >       sockname => $ldap->{net_ldap_socket}->sockname,
> >       peername => $ldap->{net_ldap_socket}->peername,
> >     );
> >
> > That seems correct for SASLv1, but not for SASLv2.  Net::LDAP is
> > unaware of the SASL version.
> >
> > So should Net::LDAP be aware of the SASL version and call
> > something like this when the SASL version is 2?
> >
> >     $sasl_conn->property(
> >       iplocalport => $ldap->{net_ldap_host},
> >       ipremoteport => $ldap->{net_ldap_peer}),
> >     );
> 
> No, Net::LDAP doesn't need to be aware about the SASL bits at all.
> 
> You are confusing the sockname from SASL v1 with the internal sockname 
> defined inside of Cyrus.so, which is created from the Cyrus.xs file from 
> Authen::SASL::Cyrus (Patrick's version), which defines sockname based on 
> the version of SASL, so that Net::LDAP doesn't have to have this knowledge.

I understand what you are saying.  Patrick added sockname and peername
compatibility into Authen::SASL::Cyrus so Net::LDAP wouldn't have to be
changed.  He then pushes the sockname through inet_ntoa producing the
dotted decimal notation of the address.

I'm saying that I don't know if that is the right thing to do to fix
the problem.

In any case, Patrick's version or modifying Mark's code from CPAN
produces the same result.

CPAN:
Use of uninitialized value in print at 
/opt/perl/lib/site_perl/5.8.4/i686-linux/Authen/SASL/Cyrus/Security.pm 
line 99, <DATA> line 283.
[ ... hang ... ]

Patrick's version:
Use of uninitialized value in print at 
/opt/perl/lib/site_perl/5.8.4/i686-linux/Authen/SASL/Cyrus/Security.pm 
line 81, <DATA> line 283.
[ ... hang ...]

Which apears to be an encoding failure

sub WRITE {
  my($ref,$string,$len) = @_;
  my($fh, $clearbuf, $cryptbuf);
                                                                                       
    
  $fh = $ref->{fh};
  $clearbuf = substr($string, 0, $len);
  $cryptbuf = $ref->{conn}->encode($clearbuf);
  print $fh $cryptbuf;
}

Which is the same in both code sets.

-- 
Larry

Reply via email to