Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fwd: BUG: Net-LDAP 0.51 is not working with Active Perl 5.16 with Socket 2.007

20 views
Skip to first unread message

Bakkiaraj Murugesan

unread,
Dec 19, 2012, 10:17:26 PM12/19/12
to perl...@perl.org
Hi LDAP Gurus,

I have migrated to perl 5.16. Below is my configuration,

Perl: ActiveState Perl 5.16 (This is perl 5, version 16, subversion 1
(v5.16.1) built for MSWin32-x86-multi-thread)

OS: Windows 7 64 bit

compiler: GCC 4.7.0

Make: dmake

I downloaded latest version of Net-LDAP module (0.51) from cpan.org,
compiled and installed. damke test PASSED no errors. But when I use the
following code,

<code>
use strict;
use warnings;
use Net::LDAP 0.51;
use Win32;
use Data::Dumper;

my $userName = Win32::DomainName().'\\'.Win32::LoginName();

my $pw="xxxxxx";


#$pw=~s/\%([A-Fa-f0-9]{2})/pack('C',hex($1))/seg;
#$pw=~s/\+/ /g;



my $host="xx.xx.xxx";

my $ldap = Net::LDAP->new($host) or die "Can't connect to LDAP server: $@";
my $mesg = $ldap->bind($userName, password=>$pw);
my $results = sprintf("%s",$mesg->error);


print "\n MSG: ",$results;

</code>

I get following error,

<snip>
syswrite() on unopened filehandle GEN0 at C:/Perl/site/lib/Net/LDAP.pm line
847, <DATA> line 581.

MSG: Bad file descriptor
</snip>

I suspect this error is caused due to "Socket.pm", I have a updated
"Socket.pm" version 2.007. When I uninstall this module , perl uses
Socket.pm from c:\perl\lib which is Socket.pm version 2.001 and I dont get
any error in Net-LDAP.

So my finding is Net-LDAP is not properly working with Sockets.pm 2.007.

Thanks for this awesome module, I use it to authenticate users in my
organization.
--
Regards,
Bakkiaraj M



--
Regards,
Bakki

Peter Marschall

unread,
Dec 26, 2012, 2:58:34 PM12/26/12
to perl...@perl.org
Hi,
I am sorry, but I do not know how the perl-ldap maintainers shall react to
this bug report.

With the exception of some symbolic constants from Socket.pm, perl-ldap
only uses Socket.pm indirectly via the IO::Socket::* family.

So, I fear there is nothing perl-ldap can do here to fix the issue-

Would you mind to inform the Socket.pm author about your finding?
Because I consider it a bug in a module if some of its - directo or indirect -
clients start to fail after a new release has come out.

But I admit I have doubts that Socket.pm changed in an incompatible way.
The only effective change between Socket 2.006 and 2.007 is:

--- Socket-2.006/Socket.xs 2012-08-19 23:31:04.000000000 +0200
+++ Socket-2.007/Socket.xs 2012-12-16 19:24:00.000000000 +0100
@@ -916,13 +916,13 @@
case AF_INET:
if(addrlen != 4)
croak("Bad address length for Socket::inet_ntop on AF_INET;"
- " got %d, should be 4");
+ " got %d, should be 4", addrlen);
break;
#ifdef AF_INET6
case AF_INET6:
if(addrlen != 16)
croak("Bad address length for Socket::inet_ntop on AF_INET6;"
- " got %d, should be 16");
+ " got %d, should be 16", addrlen);

which
a) fixes a real bug: add argument for the %d pattern
b) does not look as if it would suddenly break working implementations
of perl-ldap only.

In addition to that, I cannot reproduce the issue with Strawberry Perl
5.16.2.1 (with Socket 2.006) when connecting to a non-AD LDAP server.

So:
* Can you try reproding the issue using another LDAP server (preferably
another type. i.e. no AD)?
* Can you try reproducing the issue using the above version of Strawberry Perl
(http://strawberryperl.com/)?
* Can you double check your implementation?
I assume you did it for yourself, and did not use pre-compiled images from
somewhere on the net?

Please report back.

Thanks
PEter


--
Peter Marschall
pe...@adpm.de
0 new messages