Skip Menu |

This queue is for tickets about the Net-LDAP-SimpleServer CPAN distribution.

Report information
The Basics
Id: 100818
Status: resolved
Priority: 0/
Queue: Net-LDAP-SimpleServer

People
Owner: RUSSOZ [...] cpan.org
Requestors: ipuleston [...] SonicWALL.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.0.17
Fixed in: 0.0.18



Subject: The simple server fails to send responses. Attempts to bind to it hang.
Net::LDAP::SimpleServer does not work trying in install and use it on a Fedora 20 system. Perl is version 5.18 and the Perl modules that I have installed are a mix of the versions installed via yum, plus the latest from CPAN for those not available via yum. All are pretty much up to date as of now (see the attached make-test-out for the relevant module versions). Firstly, "make test" hangs when trying to install the module. It gets to t/14-bind.t, reports '# Binding anonymously' and then hangs there forever. I have attached the full make test output. I went ahead and installed Net::LDAP::SimpleServer anyway and found that the same happened trying to send to it from a simple script using Net::LDAP - the client script hung trying to bind. With logging turned on ('log_level => 4') I found the following in the log file. This indicates that it is failing to send back the reply to the bind request in Net::LDAP::Server because the stream that it is trying to write it to has been opened for input only: not anonymous is simple authentication binddn is ok (cn=root, o=University of Michigan, c=us) => (CN=root,O=University of Michigan,C=us) handler dn is CN=root Filehandle __ANONIO__ opened only for input at /usr/local/share/perl5/Net/LDAP/Server.pm line 142. 2014/12/09-17:33:18 Server closing! After some digging I found that the problem is due to this incorrect call to Net::LDAP::Server's new method from ProtocolHandler.pm: my $self = $class->SUPER::new( $params->{input}, $params->{output} ); Net::LDAP::Server's new method takes one argument which is the client socket, as per its documentation, so the above passes the input stream as that. Function process_request in SimpleServer.pm initializes that to '*STDIN{IO}' so we end up with Net::LDAP::Server trying to use stdin as the client socket. That works for reading the request, but not for writing the reply. I have a working fix for this and will attach a patch.
Subject: make-test-out
Download make-test-out
application/octet-stream 4.8k

Message body not shown because it is not plain text.

Subject: rt.cpan.org #100818
Date: Wed, 10 Dec 2014 09:56:50 -0800
To: "bug-Net-LDAP-SimpleServer [...] rt.cpan.org" <bug-Net-LDAP-SimpleServer [...] rt.cpan.org>
From: Ian Puleston <ipuleston [...] SonicWALL.com>
I have attached a patch to fix this (hopefully - my first time trying to add an attachment here via the mail interface). To apply this patch download it and save it somewhere, then after using tar to extract Net-LDAP-SimpleServer-0.0.17, cd into the directory and enter "patch -p1 < path-to-patch-file/SimpleServer.patch". You can then make, test and install the module as normal, and the "make test" step should now pass.

Message body is not shown because sender requested not to inline it.

Solved! The other issues are being considered as well, and soon enough we will have releases fixing those issues.