From: Graham B. <gb...@po...> - 2000-12-18 07:48:09
|
> Greetings, sir. > > I've been having some problems using Net::LDAP against an OpenLDAP server of > moderately recent version (Sorry, I don't know precisely which version). > > I have determined that the problem is due to an arguably "wrong" behavior by > the server, which is nonetheless apparently within the LDAP spec; To wit, on > query after succesful bind, the first packet returned is the bind success. > > So it goes > > >> Bind req > << Bind OK. > >> Search filter > << Bind OK. Odd. > I'll include the output from a debug => 15 session for an example below. Thanks. > I took a look at the network traffic for a similar session for the ldapsearch > client that comes with OpenLDAP, and determined that their ldapsearch discards > "Answers to messages we're not expecting answers for". > > >> Bind req > << Bind OK. > >> Search filter > << Bind OK. > [ that's useless, I'll ditch it. ] > << Search results OK. > After some noodling around in your code, I came up with the following patch > which imitates that behavior, asking for another answer if the answer received > is to a different question than I asked. > > *** /space/CPAN/build/perl-ldap-0.22/blib/lib/Net/LDAP.pm Thu Sep 14 14:53:39 2000 > --- ./LDAP.pm Sun Dec 17 21:20:31 2000 > *************** > *** 618,623 **** > --- 618,629 ---- > > my $mid = $result->{messageID}; > > + if ( $mid != $what ) > + { > + print STDERR "this ($mid) is not the message ($what) you're looking for.\n" if $debug; > + next; > + } > + > my $mesg = $ldap->{net_ldap_mesg}->{$mid} or > return LDAP_PROTOCOL_ERROR; Um no. That will break several other things, for one $what is not always defined. The fix should probably be to just change my $mesg = $ldap->{net_ldap_mesg}->{$mid} or - return LDAP_PROTOCOL_ERROR; + next; Graham. |