Bug, resolution, and patch to Net::LDAP::Server


Dear Mr. Ranellucci,

I am writing an LDAP server using this module and have found that Evolution -- at least version 2.26.1 on Ubuntu -- transmits an abandonRequest after each searchRequest. Because there is no defined return value for an abandonRequest, the Perl module closes the socket and Evolution fails thereafter to communicate with the server.

The following patch resolves the bug, by properly checking whether the request -- NOT the response type -- is defined, and only hanging up in the event of an undefined request. The patch also only sends a response for defined response types -- of which abandonRequest has none.

With this patch, a server created with the Net::LDAP::Server module functions properly with Evolution.

I hope you will agree to incorporate this into the module and update CPAN accordingly.


\/ William Lindley http://www.wlindley.com +1 480.947.6100

Patch follows. On my system, the appropriate file is:


---begin--- ` 82,83c82,85 < my $respType = $respTypes{$reqType} < or return 1; # if no response type is present hangup the connection --- > if (!defined $reqType) { > return 1; # unknown request type - hangup connection > } > my $respType = $respTypes{$reqType}; 141,142c143,146 <

and now send the result to the client < print $socket

&encoderesult($mid, $respType, $result); --- > # and now send the result, if any, to the client > if (length($respType)) { > print $socket &encoderesult($mid, $respType, $result); > }`